Re: Double Quotes In Queries

From: Date: Wed, 27 Apr 2005 16:28:08 +0000
Subject: Re: Double Quotes In Queries
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-18964@lists.php.net to get a copy of this message
On 4/27/05, pw <p.willis@telus.net> wrote: > Hello, > > I have pearDB connected to PostgreSQL. > > When I make an insert into a varchar field everything works fine, > **UNLESS** I have double quotes in my data for that field. > > For example if I use the following INSERT directly in postgres it works > fine: > > INSERT INTO mytable (a_text_field) VALUES ( 'one 19" monitor' ); > > However if I use pear and PHP to insert this record the data gets > truncated to > > 'one 19' > > Even adding a backslash as an escape character doesn't resolve the problem. > ie:INSERT INTO mytable (a_text_field) VALUES ( 'one 19\" monitor' ); > > I think I must be missing something in my php.ini or something. > Is there a flag for this? > Try using DB::quoteSmart(). -- Justin Patrin

« previous php.pear.general (#18964) next »