I'm trying to grab rows from sql using LIKE, where the key matches key array in the column.
$key = '%PDF%';
$q = mysql_query("SELECT * FROM `ads` WHERE key LIKE '$key' ORDER BY RAND() LIMIT 2");
This works fine and show the results but when i change my key to PDF FILES. i.e.:
$key = '%PDF FILES%';
It doesn't show the results as in the db there is an array of keys, please look at my db column:
Here's My sql Key column:
PDF, pdf, PDF SEARCH, pdf search, PDF ENGINE, pdf
So whats the solution? how to get results if the key is pdf files?
I think it can be by splitting the key and then matches the keywords. right?
this can be done by explode(); but how? and how to match with sql?