In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Phil Schwarzmann) wrote:

> Dumb question: How do I query results from a MySQL that I've already
> queried once before in the same page?
> 
> Here is my code:
> 
> // querying the database for the first time.
> $query  = "select * from table where thingA = $searchA";
> $result = mysql_query ($query);
> 
> // now I want to query my results I just made.

If you merely want to re-use the result set, see 
<http://www.php.net/manual/en/function.mysql-data-seek.php>.

If you want to do something more akin to a subquery (i.e. extracting a 
subset of data from the original query's result set), then use a new SQL 
statement.  For example:

$query2="select * from table where thingA=$searchA and thingB=$searchB";
$result2 = mysql_query ($query2);

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to