Jump to content

php/mysql problem!


joca91

Recommended Posts

Hello!

 

I develop at the moment an online based cycling manager!

I have a problem in the programming right know.

I want that every user have x points when they start

and can buy athletes for the points but i have some trouble.

I have two questions i want help with:

 

ONE: witch tables in the mysql would i choose? example if i buy one athlete,

the athlete adds in a seperate table "athlete" with the columns "id, athlete, user or

in the user table? please help me with a code snippet in php and mysql how i can do that.

 

TWO: when i buy one athlete the points get lower. Example. i have 1000points at start and

after buy one athlete for 120 points the points would be 880. I have test it with sql syntax UPDATE but i got the error

example if i buy ten athletes who cost 110 each it would be over 1000 points but the points get: -100 but i want the stay on 0 points

not -100. Please help me with code snippets in php how i can do that!

 

Please help me with my two problems!

 

/Johan

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.