Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 82B3D475B50 for ; Thu, 22 Aug 2002 10:13:24 -0400 (EDT) Received: from secure.pghoster.com (unknown [64.246.32.44]) by postgresql.org (Postfix) with ESMTP id 9F711475B4F for ; Thu, 22 Aug 2002 10:13:23 -0400 (EDT) Received: from pghoster.com (12-239-88-3.client.attbi.com [12.239.88.3]) (authenticated (0 bits)) by secure.pghoster.com (8.11.6/8.11.6) with ESMTP id g7MFBbd10194; Thu, 22 Aug 2002 10:11:37 -0500 Message-ID: <3D64F0EC.7000606@pghoster.com> Date: Thu, 22 Aug 2002 09:10:52 -0500 From: Roj Niyogi User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1b) Gecko/20020819 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/72 X-Sequence-Number: 1417 A good way to debug these is to put the complete query into a variable called $strSQL and then echo it to the browser. Then, examine the string to see whether the quotes pair up and that characters are escaped properly. $strSQL = "insert into site_common values ('01','00','".$tmp."')"; echo $strSQL; exit; //remove this line when you think it will work pg_query($strSQL); Roj 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) > >