Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id B63199FB625 for ; Fri, 16 Mar 2007 06:17:11 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 47403-10 for ; Fri, 16 Mar 2007 06:17:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sd-2317.dedibox.fr (sd-2317.dedibox.fr [88.191.17.192]) by postgresql.org (Postfix) with ESMTP id 6E2F19FB60B for ; Fri, 16 Mar 2007 06:17:07 -0300 (ADT) Received: from sd-2317.dedibox.fr (localhost.localdomain [127.0.0.1]) by sd-2317.dedibox.fr (Postfix) with ESMTP id 94C3BA865; Fri, 16 Mar 2007 10:17:23 +0100 (CET) Received: from [10.168.168.40] (ASt-Lambert-153-1-47-156.w81-249.abo.wanadoo.fr [81.249.102.156]) by sd-2317.dedibox.fr (Postfix) with ESMTP id 31200A1FD; Fri, 16 Mar 2007 10:17:23 +0100 (CET) Message-ID: <45FA608A.6060807@lelarge.info> Date: Fri, 16 Mar 2007 10:16:58 +0100 From: Guillaume Lelarge Reply-To: guillaume@lelarge.info Organization: PROGIMED User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Thunderbird/0.7.3 Mnenhy/0.6.0.104 MIME-Version: 1.0 To: Bart Degryse Cc: pgsql-sql@postgresql.org, Shavonne Marietta Wijesinghe Subject: Re: INSERT INTO References: <002c01c767a8$20d5d600$1102a8c0@dream> <45FA6B62.A3DD.0030.0@indicator.be> In-Reply-To: <45FA6B62.A3DD.0030.0@indicator.be> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.22 tagged_above=0 required=5 tests=AWL, BAYES_50 X-Spam-Level: X-Archive-Number: 200703/219 X-Sequence-Number: 27857 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.