N1CK3RS0N Posted October 14, 2009 Share Posted October 14, 2009 Hello. I'm trying to set the current value of a row in my SQL table +1 based on the data input. I'm not sure how, if possible, I should use operators in the query. Ideas? Thanks if ( $feedback_rating == 1 ) { $db->query_write("UPDATE " . TABLE_PREFIX . "user SET feedback_pos + 1 WHERE userid = " . $feedback_to ); } else if ( $feedback_rating == -1 ) { $db->query_write("UPDATE " . TABLE_PREFIX . "user SET feedback_neg + 1 WHERE userid = " . $feedback_to ); } Quote Link to comment https://forums.phpfreaks.com/topic/177616-solved-setting-a-value-1-using-mysql-update-query/ Share on other sites More sharing options...
trq Posted October 14, 2009 Share Posted October 14, 2009 "UPDATE " . TABLE_PREFIX . "user SET feedback_pos = feedback_pos + 1 WHERE userid = " . $feedback_to Quote Link to comment https://forums.phpfreaks.com/topic/177616-solved-setting-a-value-1-using-mysql-update-query/#findComment-936486 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.