I have mysql table (say mytable1) where values are stored as comma separated values in a column.
Now I want to fetch all rows in another table (say mytable2) where column unique_id contains value from above comma separated values.
e.g. mytable1 contains multiple rows with different unique_ids including following two given in $string.
I want to fetch only those two rows where row one unique_id is ABCD1 And row two where unique_id is BCDE2. these two unique_ids are not fixed. they may be different from different rows in mytable1
e.g.
$string = "ABCD1,BCDE2"; (retrieved from mytable1)
$query = "select * from mytable2 where unique_id = "values from $string ????";
What right $query should be ?
I couldn't figure it out with IN or FIND_IN_SET ...
your help is appreciated....