turkman Posted November 11, 2008 Share Posted November 11, 2008 Hey, I'm trying to set up a betting section for mywebsite. Its basically going to give people betting tips. But i want to update it from a content management system. Which i can do. My problem is how to store the information in the table. So say two football teams are playing. In my CMS i would have the following Event[ ]Date [ ] who is playing [ ] who will win [ ] what odds [ ] stake [ ] [submit bet] [add another team] Ok everything with this would be fine, unless i didnt want an option to add another team. I would have just set up a table and added all the following in, which i can do if they press submit bet. However if i want to recommend a multiple bet, i.e two teams or more to win. I want to be able to store that in the database. If i just add it to the database then it will have a different bet id. if i dont use bet id as an auto increment how can i keep track of what id im on. Also how can i set the html up so that when i hit a button it will add an extra row and keep all the current information stored or if that is even possible Quote Link to comment https://forums.phpfreaks.com/topic/132293-solved-help-with-how-to-set-up-this-betting-table/ Share on other sites More sharing options...
Barand Posted November 11, 2008 Share Posted November 11, 2008 A typical method would be to have 2 tables, say, "bet" and "bet_item" [pre] Bet bet_item --------- ---------- betID -----+ itemID date +--< betID userID team stake odds [/pre] Each item for a bet would have the same betID Quote Link to comment https://forums.phpfreaks.com/topic/132293-solved-help-with-how-to-set-up-this-betting-table/#findComment-687921 Share on other sites More sharing options...
turkman Posted November 11, 2008 Author Share Posted November 11, 2008 ok that makes sense. Thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/132293-solved-help-with-how-to-set-up-this-betting-table/#findComment-688040 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.