Re: escape single quote in INSERT command

From: "Dan Langille" <dan(at)langille(dot)org>
To: dave_h4(at)yahoo(dot)com
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: escape single quote in INSERT command
Date: 2002-11-26 18:47:20
Message-ID: 3DE37B68.8450.D898B9D8@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 27 Nov 2002 at 0:01, mallah(at)trade-india(dot)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/

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Martin Crundall 2002-11-26 18:59:55 Re: celko nested set functions -- tree move
Previous Message Thomas Good 2002-11-26 18:41:42 Re: escape single quote in INSERT command