From: Guillaume Lelarge <guillaume@lelarge.info>
To: Bart Degryse <Bart.Degryse@indicator.be>
Cc: pgsql-sql@postgresql.org, Shavonne Marietta Wijesinghe <shavonne.marietta@studioform.it>
Subject: Re: INSERT INTO
Date: Fri, 16 Mar 2007 10:16:58 +0100
Message-ID: <45FA608A.6060807@lelarge.info> (raw)
In-Reply-To: <45FA6B62.A3DD.0030.0@indicator.be>
References: <002c01c767a8$20d5d600$1102a8c0@dream>
<45FA6B62.A3DD.0030.0@indicator.be>
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.
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: guillaume@lelarge.info, Bart.Degryse@indicator.be, shavonne.marietta@studioform.it
Subject: Re: INSERT INTO
In-Reply-To: <45FA608A.6060807@lelarge.info>
* 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