seany123 Posted January 23, 2009 Share Posted January 23, 2009 basically all i want to do is when this page is ran... I want every user on my users table to update ABC + 5.. but i dont want ABC to go above maxABC... this is kinda a Cron but yeah.. can anybody give me a hand with this?? Quote Link to comment https://forums.phpfreaks.com/topic/142182-solved-helping-updateing-users-table/ Share on other sites More sharing options...
RichardRotterdam Posted January 23, 2009 Share Posted January 23, 2009 That would be something like this: update users set ABC=ABC+5 where ABC< maxABC but could you explain it in more detail. what is abc in it what is the name of the table is maxABC a php var a constant etc.. the more detail the better the help Quote Link to comment https://forums.phpfreaks.com/topic/142182-solved-helping-updateing-users-table/#findComment-744801 Share on other sites More sharing options...
seany123 Posted January 23, 2009 Author Share Posted January 23, 2009 well i thought they was i explained it would give the most simple answer! but yeah ill explain it... The table is infact called $players... ABC is infact Nerve. both Nerve and Maxnerve are Int(11). Both Nerve and Maxnerve's values may change. Quote Link to comment https://forums.phpfreaks.com/topic/142182-solved-helping-updateing-users-table/#findComment-744804 Share on other sites More sharing options...
RichardRotterdam Posted January 23, 2009 Share Posted January 23, 2009 Is this what you are saying? (your table structure) players: nerve int(11) maxnerve int(11) Quote Link to comment https://forums.phpfreaks.com/topic/142182-solved-helping-updateing-users-table/#findComment-744808 Share on other sites More sharing options...
seany123 Posted January 23, 2009 Author Share Posted January 23, 2009 yeah, theres more than just that but yeah Quote Link to comment https://forums.phpfreaks.com/topic/142182-solved-helping-updateing-users-table/#findComment-744810 Share on other sites More sharing options...
RichardRotterdam Posted January 24, 2009 Share Posted January 24, 2009 in that case that what I said was pretty close only that you probably want to have ABC(nerve) to be exactly maxABC(maxNerve) when it exceeds maxNerve. But which part do you not understand? And isn't this just more mysql related? update users set ABC=ABC+5 where ABC< maxABC Quote Link to comment https://forums.phpfreaks.com/topic/142182-solved-helping-updateing-users-table/#findComment-745151 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.