Re: Using results for next query

From: Date: Tue, 09 Mar 2004 01:36:32 +0000
Subject: Re: Using results for next query
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-33373@lists.php.net to get a copy of this message
In article <200403080618.i286IEmF016027@mail.healthon-net.com>, shannon@wyattgroup.com.au says... > > Hi People, > > Am needing a little help on the following scenario. > > Selecting user_id from one table for all entries that match the required > criteria. > > Now I want to use the user_id's that are returned by the previous query in > another to obtain more information from another table. > > Basically using the results of one query to become the critera for another > query and do this for all the responses from the first query. > > Any assistance would be greatly appreciated. > > Cheers, > > Shannon If there is a direct link between the tables, for instance the user_id, you could probably use a join to achieve this with just one query. Something like: SELECT user_id, othertablea, othertableb FROM userid_table, othertable WHERE [userid criteria] AND userid_table.user_id = othertable.user_id Cheers -- Quod subigo farinam A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet?

« previous php.db (#33373) next »