Re: INSERT INTO - Mailing list pgsql-sql

From Guillaume Lelarge
Subject Re: INSERT INTO
Date
Msg-id 45FA608A.6060807@lelarge.info
Whole thread Raw
In response to Re: INSERT INTO  ("Bart Degryse" <Bart.Degryse@indicator.be>)
List pgsql-sql
Bart Degryse a ecrit le 16/03/2007 10:03:
> I don't use ASP but in PHP I would do something in the line of
>  
> $valuetoinsert = "SANT'ANGELO LODIGIANO";
> $query = "INSERT INTO TABLE2 (TE_INDI) VALUES ('" . str_replace("'", 
> "''", $valuetoinsert) . "')";
>  
> I'm sure ASP has also a string replacement function
> 

This doesn't answer Shavonne's question but, instead of str_replace, you 
should better use pg_escape_string :  http://www.php.net/manual/en/function.pg-escape-string.php

Regards.


-- 
Guillaume.


pgsql-sql by date:

Previous
From: "Bart Degryse"
Date:
Subject: Re: INSERT INTO
Next
From: "Shavonne Marietta Wijesinghe"
Date:
Subject: Fw: INSERT INTO