I have a problem with <subj>. In code
$string=htmlentities("%")."text".htmlentities("%");
$query="select * from table where column like \"$string\"";
echo $query;
$result=mysql_db_query("db", "$query");
I can't find the right syntax of "%". I tried siple "%", "\%", "\045", "%" and htmlentities("%") as you see above. The $string contains the right syntax of the query. When I copy&paste the query into mysql command line, I get expected result, but in php script I don't. When the $string doesn't contain any wildcard, I get the right answer from script, too.
What is wrong?
Thanks
Mirek