title: how to store the value retrieved from query in a php array
body: <p>i have retrieved  a query and tried to store the id column in a array. and then i check two arrays to find the common using array_intersect func....     </p>
  
  <pre><code>&lt;?php
  
      $a=array(10);
      $connection = mysql_connect("localhost","root","");
      $db=mysql_select_db("data",$connection);
      $res=mysql_query("select * from usertable");
      $i=0;
      while($row=mysql_fetch_array($res))
      {
      $a[i]=$row["id"];
      $i++;
      }
      echo $a[1];
      $fb_usr_id =json_decode(  $_POST['fb_user'], true );
      $arr=array($fb_usr_id);
  
  
      $result = array_intersect($arr, $a);
      print_r($result);
      ?&gt;
  </code></pre>
  
  <p>is the way in which i stored the retrieved value in array is correct...??
  and output of this code is:</p>
  
  <p>Array ( )</p>