In table is record, field called CompanyName that has: Joe\'s Place (I
added the slashes before inserting the field.)
This will NOT work:
$x="Joe's Place";
$sql="Select * from Company where CompanyName LIKE '%" . addslashes($x) .
"%'";
(standard MySQL query code)
I don't get an error, but I don't get a hit either!
Here is the quirk. Take out the LIKE and put in an = and it works:
$sql="Select * from Company where CompanyName =' " . addslashes($x) . " ' ";
(standard MySQL query code)
Does anyone have any ideas of what is happening here?
Thanks,
Al
added the slashes before inserting the field.)
This will NOT work:
$x="Joe's Place";
$sql="Select * from Company where CompanyName LIKE '%" . addslashes($x) .
"%'";
(standard MySQL query code)
I don't get an error, but I don't get a hit either!
Here is the quirk. Take out the LIKE and put in an = and it works:
$sql="Select * from Company where CompanyName =' " . addslashes($x) . " ' ";
(standard MySQL query code)
Does anyone have any ideas of what is happening here?
Thanks,
Al
Comment