how to assign elements of one array to another array in php
<p>i retrieved data from mysql table in php</p>

<pre><code>
  $array2=array(); while($q1=  mysql_fetch_assoc($result))
{    print_r($q1);
    $array2[]= $q['user_id'];
}</code></pre>

<p>the print_r($q1) will output this <pre>Array ( [user_id] => 1 ) Array ( [user_id] => 2 ) Array ( [user_id] => 4 ) </pre>.
Now i want to assign these values into another array i.e
<pre> $array2[]=$q['user_id'];</pre> but when i echo $array2 this gives me result otherthan $print_r($q) i.e</p>

  <pre>Array ( [0] => [1] => [2] => ) </pre>

<p>my question is how can i get the value of [user_id]=>4 from this array </p>
