beennn Posted July 28, 2011 Share Posted July 28, 2011 heres what im trying to do; imageshackand iv tried mysql_query("UPDATE users SET update = update + 1 WHERE username = $show_username"); Link to comment Share on other sites More sharing options...
Ingolme Posted July 28, 2011 Share Posted July 28, 2011 I think your query has an error. Have you printed out mysql_error() and mysql_affected_rows() to see what's happening? Link to comment Share on other sites More sharing options...
Obi1-Cannabis Posted July 28, 2011 Share Posted July 28, 2011 since UPDATE is a mysql reserved word you should use `update` when refering to the column mysql_query("UPDATE users SET `update` = `update` + 1 WHERE username = $show_username"); Link to comment Share on other sites More sharing options...
beennn Posted July 28, 2011 Author Share Posted July 28, 2011 @Ingolmejust have and its not reporting any errors@Obi1aah thank you; but its still not workingcould it be that im not executing it correctly? Link to comment Share on other sites More sharing options...
Ingolme Posted July 28, 2011 Share Posted July 28, 2011 I'm quite sure that mysql_error() should be showing an error. You haven't put any quotes around the $show_username string. Link to comment Share on other sites More sharing options...
beennn Posted July 28, 2011 Author Share Posted July 28, 2011 sorry i must have typed it out wrong the first time You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update' = 'update' + 1 WHERE username = bob' at line 1what should be around $show_username? Link to comment Share on other sites More sharing options...
thescientist Posted July 28, 2011 Share Posted July 28, 2011 what did Ingolme say in his post? just look at what's around your other values and see what's missing from 'bob' Link to comment Share on other sites More sharing options...
beennn Posted July 28, 2011 Author Share Posted July 28, 2011 oooh -.- thank you, working fine now >.< Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.