From: Dan Langille <dan@langille.org>
To: dave_h4@yahoo.com
Cc: pgsql-sql@postgresql.org
Subject: Re: escape single quote in INSERT command
Date: Tue, 26 Nov 2002 13:47:20 -0500
Message-ID: <3DE37B68.8450.D898B9D8@localhost> (raw)
In-Reply-To: <47269.203.145.129.4.1038335486.squirrel@mail.trade-india.com>
References: <27ad91d2.0211220500.19633b93@posting.google.com>
On 27 Nov 2002 at 0:01, mallah@trade-india.com wrote:
> > Hi Group -
> >
> > I have a perl application for a registration form.
>
> Same Here,
>
> Why dont' you use prepare and execute in case you are using DBI
> same program is like this.
>
> $dbh = DBI -> connect ( "......");
> $sth = $dbh -> prepare("insert into tab (a,b) values (?,?)");
> $sth -> execute($a , $b );
> $sth -> finish();
> $dbh -> commit();
> $dbh -> disconnect();
IIRC, there is a dbi->quote() function as well. That should properly
escape anything.
--
Dan Langille : http://www.langille.org/
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dan@langille.org, dave_h4@yahoo.com
Subject: Re: escape single quote in INSERT command
In-Reply-To: <3DE37B68.8450.D898B9D8@localhost>
* 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