Jump to content
MakeWebGames

Recommended Posts

Posted

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

Posted

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)

Posted

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 :(

Posted

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);

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...