- Impact
- 2
Hey everyone I was wondering if anyone could help me figure out a query for a PHP Script I'm working on. I'm writing a script that lets the user make imaginary bets on sporting events and I need to find an efficient way to do something.
I've got 2 tables, one for wagers and one for combo wagers. One of the wager fields is combo_id which is always 0 unless it is a combo wager then I put in the ID of the combo wager from the combo wager table.
The wager table contains the following fields:
wager_id
line_id
oppline_id
odds
amount
combo_id
The combo table contains the following fields:
combo_id
odds
amount
I put all wagers in the wager table, but if it is a combo wager then I place a new record in the combo table and get the combo_id, I then set the combo_id of the individual wagers.
Once the combo wager is placed I need to query the wager table and get the following results: wagers where the line_id's are equal to the oppline_id from an array, and all results must have the same combo_id.
Im basically trying to query the database to see if there is another combo bet placed where the wagers have the opposite lines selected.
Any help would be greatly appreciated, I'm stumped!
Thanks
I've got 2 tables, one for wagers and one for combo wagers. One of the wager fields is combo_id which is always 0 unless it is a combo wager then I put in the ID of the combo wager from the combo wager table.
The wager table contains the following fields:
wager_id
line_id
oppline_id
odds
amount
combo_id
The combo table contains the following fields:
combo_id
odds
amount
I put all wagers in the wager table, but if it is a combo wager then I place a new record in the combo table and get the combo_id, I then set the combo_id of the individual wagers.
Once the combo wager is placed I need to query the wager table and get the following results: wagers where the line_id's are equal to the oppline_id from an array, and all results must have the same combo_id.
Im basically trying to query the database to see if there is another combo bet placed where the wagers have the opposite lines selected.
Any help would be greatly appreciated, I'm stumped!
Thanks





