pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mitch Vincent <mvincent@cablespeed.com>
To: pgsql-php@postgresql.org
Subject: Re: Re(2): Test (fwd)
Date: Thu, 14 Jun 2001 18:57:43 -0400
Message-ID: <004601c0f525$8b7d3e90$0200000a@Mitch> (raw)
References: <Pine.LNX.4.33.0106131937010.13453-100000@webdevel.urban.csuohio.edu>
	<009301c0f4da$f9a71b20$330a0a0a@rutgersinsurance.com>
	<fc.00249f0e001b95893b9aca005379f626.1b961a@irpsmail.ucsd.edu>
	<00f301c0f4f7$70ef3c00$330a0a0a@rutgersinsurance.com>

    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 <INPUT TYPE="TEXT"
NAME="Whatever" VALUE="this is what I'm "talking" about"> , 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" <aalang@rutgersinsurance.com>
To: <pgsql-php@postgresql.org>
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" <ghoffman@ucsd.edu>
> To: <pgsql-php@postgresql.org>
> Cc: <aalang@rutgersinsurance.com>
> 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
>




view thread (6+ messages)  latest in thread

Message-ID: <004601c0f525$8b7d3e90$0200000a@Mitch>
Permalink:  ../004601c0f525$8b7d3e90$0200000a@Mitch/
Also on:    postgresql.org/message-id/004601c0f525$8b7d3e90$0200000a@Mitch

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: mvincent@cablespeed.com
  Subject: Re: Test (fwd)
  In-Reply-To: <004601c0f525$8b7d3e90$0200000a@Mitch>
  References: <Pine.LNX.4.33.0106131937010.13453-100000@webdevel.urban.csuohio.edu> <009301c0f4da$f9a71b20$330a0a0a@rutgersinsurance.com> <fc.00249f0e001b95893b9aca005379f626.1b961a@irpsmail.ucsd.edu> <00f301c0f4f7$70ef3c00$330a0a0a@rutgersinsurance.com> <004601c0f525$8b7d3e90$0200000a@Mitch>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox