oh man, your design is so mess up that what you are asking is almost impossible, what I understand is that you have:
Select name from math_Details where cric_ids in (1,2,3,4,8);
and the column looks like this:
| cric_ids |
-------------
|1,2,3,5,4 |
|5,8,6,12,3|
|78,6,2,4,6|
|5,7,8,9,1 |
and you want to be able to make search by digits....
the like wont help you because the result is a string or varchar, so your possible options could be (beside that you need to use a 'like' for each option)
critics like '1' //wont work at least you only have 1 in your cric_ids
critics like '%1' // will work only if 1 is the last value
critics like '1%' //will work only if 1 is the first vaue
critics like '%1%' // will give you all values with 1, like 1, 10, 11, 111, 19, etc...
I think you have 2 options,
- make a full query and with PHP functions get the values (you can convert it to into an array and get the values), it will be SO SLOW!.....
- Redesign your database (recommended) to fix that and futures conflicts.
Please take a look to database entity relationship model and normalization.