When I replace
$ordering = "apples, bananas, cranberries, grapes";
with
$ordering = "apples, bananas, grapes";
I no longer want cranberries to be returned by my query, which I've written out like this:
$query = "SELECT * from dbname where FruitName LIKE '$ordering'";
Of Course this doesn't work, because I used LIKE wrong. I've read through various manuals that describe how to use LIKE and it doesn't quite make sense to me.
If I change the end of the db to "LIKE "apples"" that works for limiting it to just apples. Do I have to explode the ordering on the ", " or is there a way to do this in the query?