Hi
I seem to be getting this error on the reply section of my forum. I've never had this problem before and have tried google but found nothing. So, now i turn to daniweb, surly someone must be able to help me here.
This is the error:
Warning: Wrong parameter count for mysql_query() in C:\wamp\www\Rhinos 2\2nd\reply.php on line 79
The code on like 79 is :
mysql_query($insertpost) or die(mysql_query());
And this is my full code:
<?php
print "<table class='maintables'>";
print "<tr class='headline'><td>Reply</td></tr>";
print "<tr class='maintables'><td>";
if(isset($_POST))
{
$yourpost=$_POST;
$id=$_POST;
if(strlen($yourpost)<1)
{
print "You did not type in a post."; //no post entered
}
else
{
$thedate=date("U"); //get unix timestamp
$displaytime=date("F j, Y, g:i a");
//we now strip HTML injections
$name = @strip_tags($name);
$yourpost=strip_tags($yourpost);
$name = $_SESSION;
$insertpost="INSERT INTO forum(author,post,showtime,realtime,lastposter,parentid) values('$name','$yourpost','$displaytime','$thedate','$name','$id')";
mysql_query($insertpost) or die(mysql_query()); //insert post
$updatepost="Update forum set numreplies=numreplies+'1', lastposter='$name',showtime='$displaytime', lastrepliedto='$thedate' where postid='$id'";
mysql_query($updatepost) or die("Could not update post");
print "Message posted, go back to <A href='message.php?id=$id'>Message</a>.";
}
}
else
{
$id=$_GET;
print "<form action='reply.php' method='post'>";
print "<input type='hidden' name='id' value='$id'>";
print "Your message:<br><br>";
print "<textarea name='yourpost' rows='5' cols='40'></textarea><br><br>";
print "<input type='submit' name='submit' value='Post Reply'></form>";
}
print "</td></tr></table>";
?>