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....
<?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);
?>
is the way in which i stored the retrieved value in array is correct...?? and output of this code is:
Array ( )