jscix Posted April 10, 2007 Share Posted April 10, 2007 Okay, I'm pretty sure im doing this correct, as it's updating the IP Address, but it isn't incrementing the 'total' feild, the number is staying the same. Anyone? mysql_query("UPDATE `attend` SET total=total+1, ip=$curIP WHERE attend.eid = $eventid"); Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted April 10, 2007 Share Posted April 10, 2007 Have you tried printing out the error? mysql_query("UPDATE `attend` SET total=total+1, ip=$curIP WHERE attend.eid = $eventid")or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
per1os Posted April 10, 2007 Share Posted April 10, 2007 mysql_query("UPDATE `attend` SET total=(total+1), ip='$curIP' WHERE attend.eid = $eventid"); As long as attend is the table name, this should work. You have to remember that varchars need single quotes or any string, and to put math problems in parans just to be sure it produces the right result. Quote Link to comment Share on other sites More sharing options...
jscix Posted April 10, 2007 Author Share Posted April 10, 2007 Doh, yeah Im a bit slow today I guess. The syntax was off, mysql_query("UPDATE `attend` SET `total` = `total` + 1, `ip` = '$curIP' WHERE `attend`.`eid` = '$eventid'") works fine. Thanks man. Quote Link to comment Share on other sites More sharing options...
jscix Posted April 10, 2007 Author Share Posted April 10, 2007 "You have to remember that varchars need single quotes or any string, and to put math problems in parans" ah, okay. I didn't know this either. Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.