help with mysql!
Posted: Sun Jul 24, 2011 12:38 pm
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
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