-
PHP/Flash Guestbook w/LoadVars()
I'm rewriting the guestbook from the Foundation PHP Flash book as a component and I have a problem with updating 'thread replies' based on the $threadID variable from 'postreply.php'.
The first query below is ok. $threadID has a value at that point.
But the second query is not happening, and if I try to print the $threadID variable after the query, nothing is there. Data is being sent from flash by an instance of LoadVars();
code:
<?
include('common.php');
$link = dbConnect();
$posted = time();
$query = "INSERT INTO forumPosts (threadID, username, message, posted) VALUES($threadID, '$username', '$message', $posted)";
if(!mysql_query($query)) {
fail("Error inserting thread");
}
print "&thread=$threadID";
$query = "UPDATE forumThreads SET replies += 1, lastPost = $posted WHERE threadID = $threadID";
if(!mysql_query($query)) {
fail("Error inserting thread");
}
print "&result=okay";
// nothing happens
print "&thread=$threadID";
mysql_close($link);
?>
So I'm trying to increment replies and last post based on threadID(which is not being printed after second query).
How can I fix that?
Cheers,
MethodAir
Last edited by MethodAir; 01-22-2003 at 10:42 PM.
-
Works now...
"UPDATE forumThreads SET replies = replies + 1
MethodAir
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|