Received: from mail3.mx.voyager.net (mail3.mx.voyager.net [216.93.66.202]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5EN2Oa22514 for ; Thu, 14 Jun 2001 19:02:24 -0400 (EDT) (envelope-from mvincent@cablespeed.com) Received: from Mitch ([216.93.122.111]) by mail3.mx.voyager.net (8.10.2/8.10.2) with SMTP id f5EN2MB42274 for ; Thu, 14 Jun 2001 19:02:22 -0400 (EDT) Message-ID: <004601c0f525$8b7d3e90$0200000a@Mitch> From: "Mitch Vincent" To: References: <009301c0f4da$f9a71b20$330a0a0a@rutgersinsurance.com> <00f301c0f4f7$70ef3c00$330a0a0a@rutgersinsurance.com> Subject: Re: Re(2): Test (fwd) Date: Thu, 14 Jun 2001 18:57:43 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200106/26 X-Sequence-Number: 423 The apostrophe being a special character in PostgreSQL (and most other databases), it needs to be escaped if you wish it to go nicely into a query.. addslashes() and related functions will help there. Another thing to keep in mine is htmlspecialchars() -- it's very useful when someone might put a double quote in your form field -- which could seriously mess up when you have something like , sort of thing. I missed the first post so please excuse me if I'm way off base.. Good luck! -Mitch ----- Original Message ----- From: "Adam Lang" To: Sent: Thursday, June 14, 2001 1:28 PM Subject: Re: Re(2): [PHP] Test (fwd) > It could fluctuate on each database, so always check the appropriate > documentation, but... > > the standard way usually is to double the apostrophe > > O'Brien would be O''Brien (the middle is two apostrophes, not a quote) > > Adam Lang > Systems Engineer > Rutgers Casualty Insurance Company > http://www.rutgersinsurance.com > ----- Original Message ----- > From: "Gary Hoffman" > To: > Cc: > Sent: Thursday, June 14, 2001 1:12 PM > Subject: Re(2): [PHP] Test (fwd) > > > > aalang@rutgersinsurance.com writes: > > > > > >Plus, you have to make sure to check for apostrophes. That will break > > >your > > >SQL statement if someone typed them into the text field. > > > > > > > Well, this caveat had never occured to me. So how does someone enter > > strings with enclosed apostrophes, as in the Irish surname O'Mallory or > > the Yemeni placename Sana'a? > > > > Gary > > > > ************************************************************************** > > * Gary B. Hoffman, Computing Services Manager e-mail: ghoffman@ucsd.edu * > > * Graduate School of International Relations and Pacific Studies (IR/PS) * > > * University of California, San Diego (UCSD) voice: (858) 534-1989 * > > * 9500 Gilman Dr. MC 0519 fax: (858) 534-3939 * > > * La Jolla, CA 92093-0519 USA web: http://www-irps.ucsd.edu/ * > > ************************************************************************** > > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster >