I have a column (attr)
in mysql database with values like this:
1- apples, red, big, UK,
2- Green, apples, big, UK,
ETC ETC
Its basically a string of words and they can be in any order as you can see above.
I want to search inside that column using any given string. The strings can look like this:
UK, apples, Red, big,
apples, UK, big, green,
etc etc
what i need to do is to look into that column and display the results ONLY if the words given in the string matches the exact same words inside that column.
I've tried using this code:
$sql="SELECT * FROM `product_details` WHERE '$list' LIKE CONCAT('%', attr ,'%')";
where the $list
is the given strings. like: UK, apples, Red, big,
as you can see, the words exist in the database but they are in different ORDER and that is why the PHP doesn't show any result!
Could someone please advise on this issue?