Save MySQL results to an array and merge
<p>I have this code which permits me to save (i guess so) the mysql results into an array, i get then, two arrays and i need to merge them into one!</p>

<p>The problem is apparently it won't merge in the correct way, it merges but not all values..</p>

<p>What am i doing wrong here?
Thanks!</p>

<pre><code>&lt;?php 
$date1=mysql_query("SELECT date FROM date WHERE att_id='$att_id'");
$date2=mysql_query("SELECT date FROM date_pdv WHERE att_id='$att_id'");
while ($row = mysql_fetch_array($date1, MYSQL_ASSOC)) {
    printf("Data: %s", $row["date"]);
    $firstdate=$row['date'];
}
while ($row = mysql_fetch_array($date2, MYSQL_ASSOC)) {
    printf(" Data1: %s", $row["date"]);
    $seconddate=$row['date'];
}
$result = array_merge((array)$firstdate, (array)$seconddate);
print_r($result);
?&gt;
</code></pre>
