HCProfessionals Posted March 8, 2011 Share Posted March 8, 2011 $db->query( "UPDATE user_resources, user_buildings, user_units_nonbattle SET user_resources.uGold=user_resources.uGold+(user_buildings.uTownCenterLevel*(user_units_nonbattle.uMiner*10))" ); When the cron runs, it updates everyone the same regardless. Any idea what i'm doing wrong? Quote Link to comment Share on other sites More sharing options...
HCProfessionals Posted March 8, 2011 Author Share Posted March 8, 2011 $db->query( "UPDATE user_resources, user_buildings, user_units_nonbattle SET user_resources.uFood=user_resources.uFood+50+(user_buildings.uTownCenterLevel*(user_units_nonbattle.uHunter*10))" ); This one is working properly. This is also the only one that adds +50 every time the cron runs. Quote Link to comment Share on other sites More sharing options...
HCProfessionals Posted March 8, 2011 Author Share Posted March 8, 2011 Come on guys, I have my website shut down because of this. Quote Link to comment Share on other sites More sharing options...
litebearer Posted March 8, 2011 Share Posted March 8, 2011 Hmm its workday, and the people here 'donate' their time and talents PRO BONO to help others When updating a db UNLESS you use a WHERE all records will be updated Quote Link to comment Share on other sites More sharing options...
HCProfessionals Posted March 8, 2011 Author Share Posted March 8, 2011 nah, I got it. had to use LEFT JOIN statements. thanks though 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.