I am making a simple script that counts votes per day for a site and uses a
simple database, All i want to do is increment the field by one.  the first
time i run the script it works, after that it doubles it.  so instead of 1,
it adds 2. i know its doubling it because i tried adding 2, 3, and 4 and it
doubled all those...  the field is a BIGINT UNSIGNED, i've tried it with
just INT, nothing seems to work,  i used to have PHP get the field value,
increment it, then update the row in the database with the new number, it
doubleed it that way. now i use straight mySQL code to do it all in one
shot, still doubles it.. can any one help me???

heres my code... less database info :)

$results = mysql_query("UPDATE trlvotes SET i=i+1,  WHERE day LIKE '$day'");
if (mysql_affected_rows($results) == 0){
 mysql_query("INSERT INTO trlvotes (id, day, i) VALUES (null, '$day', 1)");

you can email me at [EMAIL PROTECTED]


PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to