The following variable needs to be escaped before it can be submitted as an 
MySQL query. It seems that the \0 in this string is causing me the problem. I 
have tried several functions in an attempt to escape this variable. Anybody 
got any other suggestions. The resulting string should look like this:

EBCO\\030774-006\\BUBBLER VALVE

$variable = "EBCO\030774-006\BUBBLER VALVE";

Things I have tried so far that do not work. Every one of the following 
functions results in \030 being replaced with a weird character.

echo addslashes($variable);

echo str_replace("\","\\",$variable);

echo mysql_escape_string($variable);


Here is the result of all of the above functions ( notice weird character 
after EBCO and that all the functions successfully escape the second \ 
character in between the 6 and the B in BUBBLER):

EBCO▒774-006\\BUBBLER VALVE


James

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to