Incrementing data
Posted: Wed May 01, 2002 2:44 am
Im creating a topsite list, With mysql for data.
but im having a probaly incrementing that hits in count.
i have a table called 'in', the table data is below
in int(7) NOT NULL default '0'
Here is the code i use to increment the data
$update= "UPDATE `topsites` SET `in` = 'in + 1' WHERE `id` = '$vote'";
$add_vote = mysql_db_query('netesp', $update, $mysql_link) or die(mysql_error());
the variable $vote... is defined in the url. eg http://bla.com/in.php?vote=1
were vote is the id of the site to add a vote to.
this is not working...
I tried updating it manually to 2 (without +1) and then try to execute the vote code. but it just sets it back to 0.
Any help much appreciated.
but im having a probaly incrementing that hits in count.
i have a table called 'in', the table data is below
in int(7) NOT NULL default '0'
Here is the code i use to increment the data
$update= "UPDATE `topsites` SET `in` = 'in + 1' WHERE `id` = '$vote'";
$add_vote = mysql_db_query('netesp', $update, $mysql_link) or die(mysql_error());
the variable $vote... is defined in the url. eg http://bla.com/in.php?vote=1
were vote is the id of the site to add a vote to.
this is not working...
I tried updating it manually to 2 (without +1) and then try to execute the vote code. but it just sets it back to 0.
Any help much appreciated.