I’m attempting to pull information from a MySQL table using the following query:
$skill = mysql_real_escape_string($row['skill']);
$sql = "select * from table where column = '" . $skill . "'
However, it can’t find it because it adds slashes. Here’s what the original skill is, before mysql_real_escape_string processes it: Blah blah blah blah blah '
Here’s what it becomes after getting passed through mysql_real_escape_string:
Blah blah blah blah blah blah \'
My SQL query can’t find the particular row it when it looks like that. Is there a way to get MySQL to look for the apostrophe still?
Thanks!!
This is wrong assumption.
It can’t find it because of something else.
It’s okay, the string is exactly as it should be.
There is something wrong with either your code or your data. Provide a full and reproduceable code as well as data, so we’ll be able to help you find a mistake in it.