/* query to select all models from accessories category from product table */$qry_model="select * from product_table where category_id=4";$qry_model_result=mysql_query($qry_model);while($qry_model_row=mysql_fetch_array($qry_model_result)){$desc_model_all = $qry_model_row['model'];$desc_model_all = explode(',', $desc_model_all);foreach ($desc_model_all as $value) {echo $value; /* this outputs as E73E72 */}}$mobile_model = $row['model'];if($value == $mobile_model) /* problem starts here */{$qryc="select * from product_table where model = '$value' and category_id=4";$resultc = mysql_query($qryc);if(mysql_num_rows($resultc)>0){// product detail is displayed here}