Again, let me refer you to my website: www.rezznor.com
Chose the latest post, and click on the Comment This Post button. Then click the Submit button. Yay, it works!
Then click on Home and start over, with the same post and same button. When you click Submit again, it doesn't work.
I've tried this for many of the other posts, and it will only work once, never more. Can anybody explain to me why this is happening? Here is the code I have. Thanks.
<?PHP
$pnumber = $_POST['pnumber'];
echo ('Testing page.');
echo ('<p>');
echo $pnumber;
echo ('<p>');
$db = mysql_connect("edited", "edited", "edited");
mysql_select_db("rezznor_news" ,$db);
$sqlquery = "SELECT number FROM June WHERE (number = '$pnumber')";
$result = @mysql_query ($sqlquery);
$num = mysql_num_rows($result);
echo ('<p>');
$row = mysql_fetch_array($result, MYSQL_NUM);
$number = $row[4] +1;
echo $number;
echo ('<p>');
$sqlquery = "UPDATE June SET commentnumber = ('$number') WHERE number = ('$pnumber')";
$result = @mysql_query ($sqlquery);
if (mysql_affected_rows() ==1)
{
echo ('Hurray! It updated!');
echo ('<p>');
echo ('<input type = "button" value = "Go Back" onclick = "history.go(-2)" />');
}
else
{
echo ('Boooo, it did not work.');
echo ('<p>');
echo ('<input type = "button" value = "Go Back" onclick = "history.go(-1)" />');
}
mysql_close();
?>