Received: from hermes.metasys.co.at (hermes.metasys.co.at [193.154.132.34]) by hub.org (8.8.8/8.7.5) with SMTP id FAA20465 for ; Wed, 27 May 1998 05:47:17 -0400 (EDT) Received: from metasys.co.at by hermes.metasys.co.at via ESMTP (951211.SGI.8.6.12.PATCH1502/951211.SGI) id MAA06539; Wed, 27 May 1998 12:45:45 +0200 Message-ID: <356BD0E1.CCF80D4F@metasys.co.at> Date: Wed, 27 May 1998 10:37:55 +0200 From: engelbert gruber Organization: METASYS Datentechnik X-Mailer: Mozilla 4.04 (Macintosh; I; PPC) MIME-Version: 1.0 To: Andy Lewis CC: pgsql-sql@postgreSQL.org Subject: Re: [SQL] escaping the ' References: Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353" Content-Transfer-Encoding: 7bit Andy Lewis wrote: > I am running Postgres 6.3.2 / PHP 3.0 on Linux 2.0.30. > > I have a table that has 16 text fields in it. I have a PHP form that allows a > user to enter info into that field. When a user enters an ' as in " item's " the > query will fail. I have played around with it and can execute the query without > error if I escape the ' . Such as " item\'s " > > Here's the big question: > > Is there anyway other than doing a ereg_replace(); in PHP to get around this > problem? If I do a ereg_replace("'", "\'", $f1) in the PHP file and execute it, > I have no problem. I dont recall having this problem in the earlier version of > Postgres. > how about String Functions AddSlashes (RTFM) > As always, thanks in advance! > minimum sweat -- --------------------------------------------- engelbert gruber METASYS Datentechnik - innsbruck/austria/europe email : Engelbert.Gruber@metasys.co.at webpg : http://www.metasys.co.at ---------------------------------------------