I have two tables, each of which have a column called approved.
I want to create an array filled with:
values of id from table1 where approved = 2
and
values of reference from table 2 where approved =2
this is my failed attempt:
I realise I need to learn more about using arrays, any links appreciated.
$result1 = mysql_query("SELECT id FROM $tablename1 WHERE approved = 2",$db);
$result2 = mysql_query("SELECT reference FROM $tablename2 WHERE approved = 2",$db);
while ($myrow = array_unique(array_merge( mysql_fetch_array($result1), mysql_fetch_array($result2))
{//display contents of array here}
PHP]