Perhaps you've got code hiding somewhere that's similar to:
// I have no idea what I'm doing. I shouldn't even be allowed anywhere near a DBMS
// However, let me take a blind stab in the dark at how to 'sanitize' data....
$foo = str_replace("\n", "", $foo); // line breaks scare me
$foo = str_replace("%", "", $foo); // i've seen weird queries I don't understand use %'s
$foo = addslashes($foo); // i've heard slashes make things safe...
$foo = addslashes($foo); // ... so let's be double safe
$foo = strip_tags($foo); // someone told me about XSS, but i think they just mistyped CSS? idunno...
?
EDIT: Forgot yet another function that's commonly used that has absolutely nothing to do with sanitizing data for SQL... the almighty strip_tags()!