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
https://forums.phpfreaks.com/topic/242836-phpmysql-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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