MySQL Forums
Forum List  »  PHP

Re: 1 table, 3 fields, check True/False existence of 1 id therein
Posted by: Felix Geerinckx
Date: October 18, 2005 05:49AM

Jeff Sabarese wrote:

> $checkinids = "select (select (select show_date from concerts where artist_id1=$artid) show_date
> from concerts where artist_id2=$artid) show_date from concerts where artist_id3=$artid";

Your table has a repeating group on artist_id. You should normalize it.

In the meantime, you probably want

SELECT show_date FROM concerts WHERE $artid IN (artist_id1, artist_id2, artist_id3);

--
felix
Please use BBCode to format your messages in this forum.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.