I need to check if the array stored data matches with the data present in the database. Meaning that, user will select check box data 1,4,5 which will be stored as $data[]. In database there is a table with a column ID which will have 1, 2, 3, 4, 5. Every time user selects different check box, which will be stored in $data. I want to check those values with the database ID and i want to get only those values which is stored in-front of that ID in other column called 'value'
Example: if $data has value 3, 4, then it should get the value from the database only for 4 and 5.
I am not getting how to do this comparison and get the value.
$query = "select values from customer where bname = '".$_POST['bname']."' ";
$update = DB_query($query,$db);
while($row = DB_fetch_array($update))
{
$array=explode(',',$row["values"]);
}
in_array()as suggested by Avin Varghese , it worked fine!.