Ryuujin Posted August 9, 2007 Share Posted August 9, 2007 Ok, I can't figure how to do this, what am I doing wrong? I have this code: if ($page == "Forum" && $section > "0" && $action == "postnewtopic") { $poster = $_SESSION[username]; $name = mysql_real_escape_string($_POST[title]); $message = mysql_real_escape_string($_POST[message]); mysql_query("INSERT INTO forumtopics (catparent, name) VALUES ('$section', '$name')"); mysql_query("INSERT INTO forumposts (poster, postedon, message, lastpost) VALUES ('$poster', NOW(), '$message', NOW())"); echo "Topic Posted, <a href=index.php?page=Forum§ion=$section>Continue</a>"; } It is posting into the 'forumtopics' table but not the posts table... Any help is greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/64003-running-2-queries-right-after-the-other/ Share on other sites More sharing options...
teng84 Posted August 9, 2007 Share Posted August 9, 2007 put a die mysql_query("INSERT INTO forumposts (poster, postedon, message, lastpost) VALUES ('$poster', NOW(), '$message', NOW())") or die (mysql_error()); to see whats the bug Link to comment https://forums.phpfreaks.com/topic/64003-running-2-queries-right-after-the-other/#findComment-319022 Share on other sites More sharing options...
Ryuujin Posted August 9, 2007 Author Share Posted August 9, 2007 I got no error. Not sure whats going on. Link to comment https://forums.phpfreaks.com/topic/64003-running-2-queries-right-after-the-other/#findComment-319251 Share on other sites More sharing options...
fenway Posted August 15, 2007 Share Posted August 15, 2007 Not sure, run check tables. Link to comment https://forums.phpfreaks.com/topic/64003-running-2-queries-right-after-the-other/#findComment-324720 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.