Entry
Can I have two IDs link to one record in a joining table?
Jan 28th, 2000 15:07
Matt Gregory, Chris N,
No, mySQL does not allow you to do this.
Instead, try using your sql to handle the joins via a concatiniated id
number.
exmaple:
Categories:
ID #1 = Bar
ID #2 = Club
ID #3 = Restauraunt
Dave And Busters category ID# would be 231 since it is mostly a club
with a restraunt but does have a bar as well. Then, when doing a
search for bars execute 3 queries, listing all 1xx IDs first, since
their primary category is bar, then run on x1x and then on xx1 and you
have everything which is a bar listed by priority (plus whatever else
you order on.) This should give you the effect you are looking for.