How do i create the array with the values being fetched from database in php
<p>Say i am having set of rows in a table and each row is having a column called city  with  some values assigned to it 
  iam iterating through the result set  and  i need to assign the list of city values of each row  in to an array only unique</p>

<pre><code>     foreach($res as $row){
       $cities =array();
       $cities[] = $row['city'];
       //when i say 
       var_dump($cities);
       //Iam not able to get array .how do i do that 
       $maincities = array('A','B',C)
     }
</code></pre>
