updating mysql database with php variable -


i want update mysql database, using php using variable method not updating. don't know problem is. code:

$result = mysql_query("select * total") or die(mysql_error());   $i=$row['number']; $n=$i+1; $result = mysql_query("update total set number = " . $n . " number = " . $i . "") or die(mysql_error());   

how can update mysql database using php?

you can increment column_value column_name = column_name + 1 without using select.

update total set number = number + 1 

Comments