When I run my code I cannot retrieve the entry that I am targeting because the keywords that are being run through the query are not the same as the keywords in the database.
Keywords:
$keywords = 'spaghetti,macaroni,hamburger';
Query:
mysql_query("SELECT * FROM ---- WHERE keywords LIKE '%$keywords%' ORDER BY id DESC LIMIT 1");
I am targeting an entry with these keywords:
food, restaurant, hamburger, spaghetti, taco,pie
I may be missing something simple here since I’ve been working for 12 hours straight. However, I’ve had no luck with anything I’ve tried to do to work around this issue.
From my point of view the query should be returning the target entry since there are 2 matching keywords.
What should I be doing differently?
1 Answer