joca91 Posted July 26, 2011 Share Posted July 26, 2011 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 More sharing options...
WebStyles Posted July 26, 2011 Share Posted July 26, 2011 something like: table points: userID, points on login, get user's available points. only show buy button when price is lower than available points. Link to comment https://forums.phpfreaks.com/topic/242836-phpmysql-problem/#findComment-1247241 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.