Derleek Posted June 10, 2008 Share Posted June 10, 2008 i am basically wondering what the syntax for a MySQL command that is the same as $variable+= 5; in php... $upPoints = "UPDATE fans SET pPoints= pPoints+'$totalPoints' WHERE id = '$guy'"; doesn't seem to be working... Quote Link to comment Share on other sites More sharing options...
luca200 Posted June 10, 2008 Share Posted June 10, 2008 doesn't seem to be working... what do you mean by this? Quote Link to comment Share on other sites More sharing options...
Barand Posted June 10, 2008 Share Posted June 10, 2008 do you execute the query and check for errors? mysql_query ($upPoints) or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
Derleek Posted June 10, 2008 Author Share Posted June 10, 2008 yeah, i got the standard error message... SQL syntax error or whatever Quote Link to comment Share on other sites More sharing options...
Barand Posted June 10, 2008 Share Posted June 10, 2008 That's why it doesn't work, then. Quote Link to comment Share on other sites More sharing options...
luca200 Posted June 10, 2008 Share Posted June 10, 2008 yeah, i got the standard error message... SQL syntax error or whatever Do you think posting the actual error could help or think we all are geniuses of the lamp? Quote Link to comment Share on other sites More sharing options...
fenway Posted June 11, 2008 Share Posted June 11, 2008 yeah, i got the standard error message... SQL syntax error or whatever Why the single quotes around your PHP variable? Quote Link to comment Share on other sites More sharing options...
revraz Posted June 11, 2008 Share Posted June 11, 2008 Not really a "standard" error, it will state what the actual error is. yeah, i got the standard error message... SQL syntax error or whatever Quote Link to comment Share on other sites More sharing options...
Derleek Posted June 11, 2008 Author Share Posted June 11, 2008 sorry about the lack of activity. as it turns out I was trying to update and add to a null value... which doesn't work to well in addition, i put the ' ' around my php variables because i thought they were needed for some reason.. guess not eh? Quote Link to comment Share on other sites More sharing options...
revraz Posted June 11, 2008 Share Posted June 11, 2008 If it's a string you do, if it's a number/int you don't. 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.