I have the following code:
mysql_query("SELECT * FROM list WHERE name LIKE '%'$searchTerm'%' OR description LIKE '%'$searchTerm'%';");
The only problem is, in pure SQL, such a query would look like:
SELECT * FROM list WHERE name LIKE '%asdf%' OR description LIKE '%asdf%'
What I'm confused about is how to put my variables into the string properly, normally a variable in a mysql_query would be surrounded by single quotes, but the addition of the single quotes in the SQL itself is confusing me.
I tried concatenating with .
but I don't think that's a good solution.