Jump to content

Running 2 Queries right after the other


Ryuujin

Recommended Posts

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&section=$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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.