Snatchy Posted April 24, 2007 Share Posted April 24, 2007 I'm adding a 1/4 will pot to the game but after many attempts at gettignt he query to work right the one i have working seems to add will to over 100% which is a bit of a pain in the but. I know there is something missing to make this work so i was just wondering if someone could help me add to it. The query i have so far that adds 25% is this... mysql_query("UPDATE users SET will=(will+(willmax*25/100)) WHERE userid=$userid",$c); Now i just need to make it so it stops at 100% and doesn't go over. any help is gratefull... Cheers Snatchy Quote Link to comment Share on other sites More sharing options...
vinyl Posted April 24, 2007 Share Posted April 24, 2007 Re: adding 1/4 will pot to the game execute a second query UPDATE users SET will=maxwill WHERE will>maxwill a 25% solution for the original question would be: will=will+(maxwill/4) as any pie divided into 4 pieces = 4 x 25% (willmax is "house will", can be confusing) Quote Link to comment Share on other sites More sharing options...
seanybob Posted April 24, 2007 Share Posted April 24, 2007 Re: adding 1/4 will pot to the game "Warning - while you were reading a new reply has been posted. You may wish to review your post." vinyl beat me to it... naturally :( Quote Link to comment Share on other sites More sharing options...
Snatchy Posted April 26, 2007 Author Share Posted April 26, 2007 Re: adding 1/4 will pot to the game is there a reason why this wouldn't be working? mysql_query("UPDATE users SET will=maxwill WHERE will>maxwill WHERE userid=$userid",$c); Quote Link to comment Share on other sites More sharing options...
Decepti0n Posted April 26, 2007 Share Posted April 26, 2007 Re: adding 1/4 will pot to the game i think its, UPDATE users SET will = maxwill WHERE will > maxill AND userid = $userid Quote Link to comment Share on other sites More sharing options...
Snatchy Posted April 26, 2007 Author Share Posted April 26, 2007 Re: adding 1/4 will pot to the game woot woot it's working!!!! THANKING YOU DECEPTION 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.