Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 061DE47580E for ; Thu, 22 Aug 2002 20:36:09 -0400 (EDT) Received: from smtp.gssf.org (smtp.gssf.org [209.102.124.32]) by postgresql.org (Postfix) with ESMTP id 50C90474E49 for ; Thu, 22 Aug 2002 20:36:08 -0400 (EDT) Received: from r7m3j6 (pdx-ppp224.pop1.net [209.102.127.59]) by smtp.gssf.org (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id RAA29855 for ; Thu, 22 Aug 2002 17:36:53 -0700 From: hodges@xprt.net X-Authentication-Warning: smtp.gssf.org: Host pdx-ppp224.pop1.net [209.102.127.59] claimed to be r7m3j6 To: pgsql-php@postgresql.org Date: Thu, 22 Aug 2002 17:36:06 -0700 MIME-Version: 1.0 Subject: Re: parsing html in pgsql using php Message-ID: <3D652106.17202.396780@localhost> In-reply-to: <3D64EFE3.1060804@centennialwines.com> X-mailer: Pegasus Mail for Windows (v4.02) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/77 X-Sequence-Number: 1422 Another way to do this is with a "here doc" block: $sample = <<< HERE quote marks in here don't need to be escaped. it will look just like plain html code. also good for queries HERE; print ("$sample"); Tom On 22 Aug 2002 at 9:06, David C. Brown wrote: > 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 = " > > > > >align='right'> > > > >
> background-color: #f0f0f0;\"> > > 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) > > > > > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html >