You don't have to use the same variable name to store the second results pointer.
$resulta = mysql_query(); whle ($row = mysql_fetch_row($resulta)) { $resultb = mysql_query(); while ($row = mysql_fetch_row($resultb)) { } } - Kevin ----- Original Message ----- From: "CF High" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 03, 2003 5:45 PM Subject: [PHP] Run db query with db query? > Hey all. > > Got a problem here: > > 1) I have a page that queries our db for info > > 2) Based on the # of rows returned I loop through to create a set of > formfields for each customer > > 3) Within this loop I run another query to retrieve option elements for > a particular category > > The problem is that the inner query is overwriting the result resource for > the outer query. So: > > while ($q = mysql_fetch_row($result)) { > > build form tables for each client and run inner query > > html stuff > > /* Calls db query to populate particular option category */ > write_select_options($tables,$form_fields,$where_clause); > > } > > What's the conventional method for running queries within queries? > > Any leads most appreciated, > > --Noah > > -- > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php