I can't think of a way to do this, any help is appreciated =)
Imagine the following tables
table "usr" (holds all users)
id (int) | name (varchar)
table "clanlist" (holds all clans)
id (int) | name (varchar)
table "clanmembers" (holds all members of all clans)
uid (int, points to a user in "usr") | cid (int, points to a clan in
"clanlist")
You might wonder why I don't simply add a clan field to the user table, and
I can't
since a user can be in any number of clans at the same time.
table "tour_competitors"
id (int) | cid (points to a clan in "clanlist") |
table "tour_players"
pid (int, points to a "tour_competitors" row) | uid (points to a row in
table "usr")
Now, the problem:
I want to select each row from table "tour_players" and get the following info:
tour_players.pid | usr.name | clanlist.name
clanlist.name relates to usr.name via
tour_players.pid = tour_competitors.id and tour_competitors.cid = clanlist.id
I've worked with this problem a loong time now, mysql only returns 0 rows
on my queries, so I'm doing something
veeery wrong. If any of you have a thought on how to restructure these
table for easier use, any suggestion is
welcome, however i can't possibly think of a layout which will provide me
with the same flexibility.
thanks in advance!
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
- Re: A query construction problem Blaster
- Re: A query construction problem mysql-list-bot