php mysql result
Posted: Sun Oct 09, 2005 2:52 pm
hi, ive made this script but it doesnt work..
could someone please tell me whats wrong with that, error messages say its this part, "$number = mysql_result($voteresult);". thanks
Code: Select all
<?
mysql_connect("localhost","root","password");
mysql_select_db("dave");
$voteresult = mysql_query("SELECT number FROM votegood WHERE dave=1");
$number = mysql_result($voteresult);
mysql_query("UPDATE votegood SET number=$number+1 } WHERE dave=1");
mysql_close();
?>could someone please tell me whats wrong with that, error messages say its this part, "$number = mysql_result($voteresult);". thanks