Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 0A15C4759B0 for ; Thu, 22 Aug 2002 10:09:57 -0400 (EDT) Received: from enterprise.centliq.com (adsl-65-71-224-185.dsl.rcsntx.swbell.net [65.71.224.185]) by postgresql.org (Postfix) with ESMTP id 0733C475974 for ; Thu, 22 Aug 2002 10:09:56 -0400 (EDT) Received: from centennialwines.com (unknown [192.168.1.2]) by enterprise.centliq.com (Postfix) with ESMTP id 3DF6CFF009; Thu, 22 Aug 2002 08:06:22 -0500 (CDT) Message-ID: <3D64EFE3.1060804@centennialwines.com> Date: Thu, 22 Aug 2002 09:06:27 -0500 From: "David C. Brown" User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Clio Cc: pgsql-php@postgresql.org Subject: Re: parsing html in pgsql using php References: <20020822135952.GD76528@zgia.zp.ua> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/71 X-Sequence-Number: 1416 You need to escape your apostrophes. Your query statment uses apostrophes and you have them in the string that your inserting into the db. I believe you can use addslashes() and stripslashes() to help you with this. http://www.php.net/manual/en/function.addslashes.php Dave Clio wrote: >Subject ... how to? > >here is an example: > > > >$tmp = " > > > >
> Sample text in table. >
> >"; > >pg_connect("host=localhost dbname=daatabase user=web_user password=password"); > >pg_query("insert into site_common values ('01','00','".$tmp."')"); > > >?> > > >Here is an error: > > >Warning: pg_query() query failed: ERROR: parser: parse error at or near "175" in /w/devel/test/dbinsert.php on line 80 > > >Any ideas? > > >/ Clio > > >---------------------------(end of broadcast)--------------------------- >TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > > >