From: | Roj Niyogi <niyogi(at)pghoster(dot)com> |
---|---|
To: | Clio <clio(at)zgia(dot)zp(dot)ua> |
Cc: | pgsql-php(at)postgresql(dot)org |
Subject: | Re: parsing html in pgsql using php |
Date: | 2002-08-22 14:10:52 |
Message-ID: | 3D64F0EC.7000606@pghoster.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-php |
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:
>
><?php
>
>
>$tmp = "
>
><table width='175' cellSpacing='0' cellPadding='0' border='0' align='right'><tr>
> <td align='center' vAlign='middle' style=\"border: 1px solid black; background-color: #f0f0f0;\">
> Sample text in table.
> </td>
></tr></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(at)postgresql(dot)org)
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Haddon | 2002-08-22 16:14:37 | FW: Nextval Problems |
Previous Message | David C. Brown | 2002-08-22 14:06:27 | Re: parsing html in pgsql using php |