Jump to content

[SOLVED] Help with how to set up this betting table


turkman

Recommended Posts

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

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

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.