I want to nest mySQL queries such that the result from one query are used to form the Select of the 2nd query. (nested While loops).
In Perl, you can simply create different database handles so that the querys don't overwrite each other. (Using the DBI module)
i.e.
while ($ary = $sth->fetchrow_array()) {
$sth_2->execute($ary[0]);
while ($ary_2 = $sth_2->fetchrow_array()) {
... perform routine here...
}
}
How do I set something up in a similar manner using PHP? (Please, no suggestions to break up the routine. )
I've tried doing:
$query_1 = mysql_query($select_1);
$query_2 = mysql_query($select_2);
but that doesn't work.