Hi Guys,
This is section of my script that i can't get to work. Everything passes as normal except the $post_id value, it always equals "0" and not the new value that was inserted into the auto_incremented field.
Any ideas?
mysql_select_db("typhoon");
$query = "insert into posts(name, email, topic_name, post, time_stamp, last_post, autorespond, domain)
values('$name','$email','$topic_name','$post','$time_stamp','$last_post','$autorespond','$domain')";
$post_id = mysql_insert_id();
?>
<META HTTP-EQUIV="refresh" CONTENT="3; URL=typh_forum1.php?id=<?=$post_id?>">
<?
$result=mysql_query($query);
if($result)
echo "<font face=Verdana, Arial size=2>Your post was successfully inserted into the database.</font><br>";
echo "<font face=Verdana, Arial size=2>If you do not get automatically directed back to the forum index click on the \"Back to main page\" link below</font><br>";
}
echo "<br><a href=\"typh_forum.php\">Back to main page</a></div>";
?>