James E Hicks III wrote:
I am experiencing some weird problems with PHP. When I execute the following
query from within a PHP script, the description is set to 'EBCO' and not
'EBCO\030774-006\BUBBLER VALVE'. When I execute this query from the mysql
monitor the value is inserted correctly.

$query = "update the_table
             set description = 'EBCO\\030774-006\\BUBBLER VALVE'
           where item_number = '1'";
mysql_query($query);


This statement prints to console incorrectly (notice funky character after EBCO):

echo ("EBCO\030774-006\BUBBLER VALVE");
EBCO774-006\BUBBLER VALVE

\0 is a NULL character, IIRC. Either use single quotes:


echo ('EBCO\030774-006\BUBBLER VALVE');

or use two slashes, like you did above:

echo ("EBCO\\030774-006\\BUBBLER VALVE");

---John Holmes...



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



Reply via email to