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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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