Hi
Can anyone explain, how i can escape wildcard chars like % in the mysql like statement.
For example consider the below query
$keyword = ‘100’;
$query = “SELECT * FROM someTable
WHERE keyword
LIKE '%”.$keyword."%’ ";
In the above case it will work fine and will list all records matching 100. Now i want to list all records matching the keyword ‘100%’. I want 100% to matches one-hundred-percent and not just any string starting with a hundred. How will i do this. I have tried to escape it using addslashes/mysql_real_escape. Both will not escape %.
Can anyone suggest a solution with an example.
Many Thanks
Jans