I have a MySQL table where I am using comma separated values like:
user_name books
abc PHP,Java
xyz Net,Shift,PHP
I can handle comma-separated value searching using the FIND_IN_SET
function of MySQL.
Now books names are auto suggested means if any one search with keyword "J" , system should search and match the word Java and give result of user "abc".
I tried to use like clause with FIND_IN_SET
but it's not working. Does anyone have any suggestions?
Not a clean solution but you can use something like this:
SELECT * FROM `library` WHERE `books` LIKE 'J%' OR `books` LIKE '%,J%'