Re: Inner Join or 2nd Query...?
| From: | Mark Sargent | Date: | Wed, 11 May 2005 14:31:21 +0000 |
| Subject: | Re: Inner Join or 2nd Query...? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-214940@lists.php.net to get a copy of this message | ||
Mark Rees wrote:
Hi All, with wanting to show both product types(Switch, Router etc) and Makers(Cisco, Avaya, etc) on the one page in select boxes, I was wondering, do you use 2 seperate queries to the database or do you inner join to get all in 1..? I have set up different tables with related id's etc. So, to get Products.product_name and Products.product_id along with what the below query pulls, what wold be best..? I believe if I do a 2nd query, than some variables need to be identified with the particular query, yes..? Cheers. ---------------------------------------- What is your question in one sentence? Is it "how do I do an inner join"? I guess I was looking for people's opinions, not a specific answer, I think...
Is it "are two separate queries on two tables faster than one query on both tables"? Well, again, no not really. I guess I was curious how others do things.
Or something else entirely? Could be. Sorry, perhaps I'm thinking too general with this, yes..? Cheers.Mark Sargent.