2008年12月22日星期一

Re: [fw-db] Re: [Postgresql] Syntax error



On Sat, Dec 20, 2008 at 7:15 PM, till <klimpong@gmail.com> wrote:
On Fri, Dec 19, 2008 at 11:43 AM, Thomas VEQUAUD
> Yep, you're right... Here is the stack trace :
> Fatal error: Uncaught exception 'Zend_Db_Statement_Exception' with
> message 'SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or
> near "." LINE 2: INNER JOIN "is" ON us.user_id = is.user_id ^' in

I think the us.user_id or is.user_id has to be quoted as well and it
doesn't look like it's quoted. I'm not an expert when it comes to
postgresql but I suppose they have reserved words as well (that's
somewhere I suggest you research first) and I think there is your
conflict. ;-)

You double check the above and run the query in phppgadmin and see how
it escapes it, or if it complains right away.

Hummm yes! I know cause it was my original question!



Another idea is that the syntax is slightly off.

Try this style:
SELECT * FROM foo INNER JOIN bar ON (foo.foo = bar.bar)

Actually, this code is generated by ZF..

没有评论: