hi guys!
currently i am really in bad situation i m trying to compare two column values from different tables.
but the thing is theses are coma separated values like (1,2,3,4,5…)
ohky now come to the point
i have two tables table one and table two
inside of table one i have these columns
and in table two
Now what i want is compare the val2 column of table two with all the values val2 of table two
for example:
in table two where val1=1 would be compare with val2 all columns
result would be like:
if 74,75 value of table two is compare with value of table one 74,75
then common answer will be retuen
1 of val1 column of table one and display 74,75 are common
again if 74,75 value of table two is compare with value of table one 73,74
then common answer will be retuen
2 of val1 column of table one and display only 74 is common
here is the code which i use to compare
$a = "74,75";
$b = "74,75";
$a_arr = explode(",", $a);
$b_arr = explode(",", $b);
$values_in_both = array_intersect($a_arr, $b_arr);
foreach($values_in_both as $rrr)
{
echo $rrr;
}
output: 74
75
can any one know the solution? please reply i relay thankful if you know the code in php.
i know experts are here…