id v id
Posted: Wed Oct 27, 2004 8:16 pm
hello there,
im relatively new to php but im undertaking a task which is starting to baffle me...
firstly im creating a league which has teams, fixtures, pm systemetc etc
i have created a basic one but since im so new my design was not good enough and am looking to redo the whole thing.
ok onto my current problem,
each team in the league is assigned an id of course and this all works fine, got the teams up the leagues and all that jazz, but when it comes to fixtures i have a problem,
i want team_id v team_id but i couldnt find a way of doing this succesfully so i resorted to making a fixture table with team1_id v team2_id this then means to do a search for a teams fixtures i have to do select blah from fixtures where team1_id=$team_id OR team2_id=$team_id
this of course works but is messy and generates probelms for me when adding to the scripts and doing table joins etc
as i said im quite new to programming so i dont know if i explained this well but it is causing me problems,
how can i make it so i can do a fixtures table with two fields of id, or am i looking at it from a completely wrong angle?
any help on this would be greatly appreciated
thanks
pure_phase
im relatively new to php but im undertaking a task which is starting to baffle me...
firstly im creating a league which has teams, fixtures, pm systemetc etc
i have created a basic one but since im so new my design was not good enough and am looking to redo the whole thing.
ok onto my current problem,
each team in the league is assigned an id of course and this all works fine, got the teams up the leagues and all that jazz, but when it comes to fixtures i have a problem,
i want team_id v team_id but i couldnt find a way of doing this succesfully so i resorted to making a fixture table with team1_id v team2_id this then means to do a search for a teams fixtures i have to do select blah from fixtures where team1_id=$team_id OR team2_id=$team_id
this of course works but is messy and generates probelms for me when adding to the scripts and doing table joins etc
as i said im quite new to programming so i dont know if i explained this well but it is causing me problems,
how can i make it so i can do a fixtures table with two fields of id, or am i looking at it from a completely wrong angle?
any help on this would be greatly appreciated
thanks
pure_phase