MySQL Forums
Forum List  »  PHP

Re: Trying to get categories and relational table information in one query
Posted by: laptop alias
Date: May 31, 2012 03:47AM

>But I want the categories table to only show one result for each record and a 1 >if there is a link and 0 if there isn't.

Isn't that what my example does?

Also, note that your surrogate `link_id` is probably redundant. At the very least, you should have a UNIQUE key on (idPost`,`idCat`).

Options: ReplyQuote


Subject
Written By
Posted
Re: Trying to get categories and relational table information in one query
May 31, 2012 03:47AM


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.