pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andy Lewis <alewis@mpsi.net>
To: pgsql-sql@postgreSQL.org
Subject: escaping the '
Date: Fri, 22 May 1998 09:00:35 -0500 (CDT)
Message-ID: <Pine.LNX.3.95.980522085023.14868A-100000@shell.mpsi.net> (raw)

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.

As always, thanks in advance!

Andy





view thread (3+ messages)  latest in thread

Message-ID: <Pine.LNX.3.95.980522085023.14868A-100000@shell.mpsi.net>
Permalink:  ../Pine.LNX.3.95.980522085023.14868A-100000@shell.mpsi.net/
Also on:    postgresql.org/message-id/Pine.LNX.3.95.980522085023.14868A-100000@shell.mpsi.net

 · 

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-sql@postgresql.org
  Cc: alewis@mpsi.net
  Subject: Re: escaping the '
  In-Reply-To: <Pine.LNX.3.95.980522085023.14868A-100000@shell.mpsi.net>
  References: <Pine.LNX.3.95.980522085023.14868A-100000@shell.mpsi.net>

* 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