orsino Posted February 8, 2020 Share Posted February 8, 2020 hey i have this line in my daily cron $db->query("UPDATE `users` SET `steps`=`steps`= 100 WHERE `steps` < 100"); so steps in users schould get 100 each day but the line doesnt work did i overlook something ? or is it sql related ? sql is steps int11 unsigned Quote Link to comment Share on other sites More sharing options...
Mark Topper Posted February 8, 2020 Share Posted February 8, 2020 Depending on what you are trying, this first query will set the step to be 100: UPDATE `users` SET `steps` = 100 WHERE `steps` < 100 The next one will add 100 to the step: UPDATE `users` SET `steps` = `steps` + 100 WHERE `steps` < 100 Quote Link to comment Share on other sites More sharing options...
ags_cs4 Posted February 8, 2020 Share Posted February 8, 2020 `steps`=`steps`= the error is here just use one `steps`= Quote Link to comment Share on other sites More sharing options...
Curt Posted February 8, 2020 Share Posted February 8, 2020 $db->query("UPDATE `users` SET `steps`= 100 WHERE `steps` < 100"); Quote Link to comment Share on other sites More sharing options...
orsino Posted February 9, 2020 Author Share Posted February 9, 2020 already found it thx 1 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.