Re: Very Wierd Problem
| From: | John W. Holmes | Date: | Sat, 14 Jun 2003 21:08:40 +0000 |
| Subject: | Re: Very Wierd Problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-151510@lists.php.net to get a copy of this message | ||
James E Hicks III wrote:
Use mysql_escape_string(). $safe = mysql_escape_string('EBCO\\030774-006\\BUBBLER VALVE'); $query = "insert into table (field) values ('$safe')"; ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals – www.phparch.com\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...Problem is that this description is coming from a DB, that's why I was trying to use addslashes, which caused me the same problems.