I have a query as follows :
$q1 = "
SELECT
*
FROM
tbl_profile
WHERE
admin_selected = 'y'
";
$res1 = mysql_query($q1);
$r1 = mysql_fetch_object($res1);
//print_r($r1);
$q2 = "
SELECT
*
FROM
tbl_profile
WHERE
admin_selected = 'n'
";
$res2 = mysql_query($q2);
$r2 = mysql_fetch_object($res2);
//print_r($r2);
?>
Now I want to add the two results $r1 and $r2 into a single array of object say $r. How can I do that ?
Why would you like to split it into 2 query statements? You can do it in just one statement.
The fetch function will produce an array that holds values of both admin_selected.