Skip navigation links

MySQL Forums :: PHP :: Trying to get categories and relational table information in one query


Advanced Search

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
Trying to get categories and relational table information in one query Steven B 05/30/2012 05:03PM
Re: Trying to get categories and relational table information in one query Peter Brawley 05/30/2012 08:20PM
Re: Trying to get categories and relational table information in one query Steven B 05/31/2012 12:32AM
Re: Trying to get categories and relational table information in one query laptop alias 05/31/2012 01:52AM
Re: Trying to get categories and relational table information in one query Steven B 05/31/2012 02:43AM
Re: Trying to get categories and relational table information in one query laptop alias 05/31/2012 03:47AM
Re: Trying to get categories and relational table information in one query Steven B 05/31/2012 03:56PM
Re: Trying to get categories and relational table information in one query laptop alias 05/31/2012 05:21PM
Re: Trying to get categories and relational table information in one query Steven B 05/31/2012 06:34PM
Re: Trying to get categories and relational table information in one query laptop alias 06/01/2012 01:19AM
Re: Trying to get categories and relational table information in one query Steven B 06/01/2012 03:50AM
Re: Trying to get categories and relational table information in one query laptop alias 06/01/2012 07:28AM
Re: Trying to get categories and relational table information in one query Steven B 06/02/2012 01:13AM
Re: Trying to get categories and relational table information in one query Barry Galbraith 06/01/2012 06:52PM


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.