I have two compare two values (say $sid1 and $sid2) and match them and find out the total number of similar and dissimilar values (I mean count the values). Please help me by giving the coding for
1) Storing the values fetched from while loop in array
2) Comparing the two arrays to count the similar and dissimilar values
**My Program**
$sql="select * from table1 where qn1='$op2'";
$ds=mysql_query($sql);
while ($r=mysql_fetch_array($ds)) {
$sid1=$r[‘a’];
//need correct syntax for the below
$a[]= $sid1;
}
$sql2="select * from table2 where qn4='$op3'";
$ds2=mysql_query($sql2);
while ($r2=mysql_fetch_array($ds2)) {
//need correct syntax for the below
$sid2=$r2[‘a’];
$b[]= $sid2;
}
//how to match the array and count
Array ($a[] == $b[])