Adding a value to a row using no variable
Posted: Wed Sep 14, 2005 6:03 pm
I want to add 1 to a row that holds an integer without using something like this:
Instead is there a way I could do it something like this?:
Code: Select all
$total = $row['hits'] + 1;
$query = "UPDATE `affiliates` SET `hits` = '$total' WHERE `id` = '$id'";
$result = mysql_query($query) or die(mysql_error());Code: Select all
$query = "UPDATE `affiliates` SET `hits` = '$total' WHERE `id` = 'id++'";
$result = mysql_query($query) or die(mysql_error());