Re: Double Quotes In Queries
| From: | pw | Date: | Wed, 27 Apr 2005 18:52:42 +0000 |
| Subject: | Re: Double Quotes In Queries | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-18965@lists.php.net to get a copy of this message | ||
Justin Patrin wrote:
On 4/27/05, pw <p.willis@telus.net> wrote:Hello, Thanks for your help. quoteSmart doesn't appear to fix the problem. Do I run the complete query string through quoteSmart or just the field data? So far I've just run the field data through which adds a slash in front of the double quote. (just like my previous experiments) PeterHello, 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().