Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id E19289FB87D for ; Fri, 16 Mar 2007 07:31:32 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 15378-09 for ; Fri, 16 Mar 2007 07:31:29 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from smtpout13.attiva.biz (smtpout13.attiva.biz [85.37.16.15]) by postgresql.org (Postfix) with ESMTP id 8FDCA9FBA85 for ; Fri, 16 Mar 2007 07:31:28 -0300 (ADT) Received: from fbcmfe02b11.fbc.local ([192.168.30.92]) by smtpout13.attiva.biz with Microsoft SMTPSVC(6.0.3790.1830); Fri, 16 Mar 2007 11:31:26 +0100 Received: from dream ([88.34.161.130]) by fbcmfe02b11.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Fri, 16 Mar 2007 11:31:26 +0100 Message-ID: <001201c767b6$40cc2d20$1102a8c0@dream> Reply-To: "Shavonne Marietta Wijesinghe" From: "Shavonne Marietta Wijesinghe" To: References: <002c01c767a8$20d5d600$1102a8c0@dream> <45FA6B62.A3DD.0030.0@indicator.be> <45FA608A.6060807@lelarge.info> Subject: Re: INSERT INTO Date: Fri, 16 Mar 2007 11:31:26 +0100 Organization: Studio FORM MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-OriginalArrivalTime: 16 Mar 2007 10:31:26.0639 (UTC) FILETIME=[4073D3F0:01C767B6] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.891 tagged_above=0 required=5 tests=AWL, BAYES_50, INFO_TLD X-Spam-Level: X-Archive-Number: 200703/221 X-Sequence-Number: 27859 i took a look at the link Guillaume gave me. But it also explains on PHP i'm using ASP :( ----- Original Message ----- From: "Guillaume Lelarge" To: "Bart Degryse" Cc: ; "Shavonne Marietta Wijesinghe" Sent: Friday, March 16, 2007 10:16 AM Subject: Re: [SQL] INSERT INTO > 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.