Re: escape single quote in INSERT command - Mailing list pgsql-sql

From Dan Langille
Subject Re: escape single quote in INSERT command
Date
Msg-id 3DE37B68.8450.D898B9D8@localhost
Whole thread Raw
In response to Re: escape single quote in INSERT command  (<mallah@trade-india.com>)
List pgsql-sql
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/



pgsql-sql by date:

Previous
From:
Date:
Subject: Re: escape single quote in INSERT command
Next
From: Thomas Good
Date:
Subject: Re: escape single quote in INSERT command