468,556 Members | 2,382 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,556 developers. It's quick & easy.

Syntax errorr

I keep getting a syntax errorr with this code and having problems
figuring out the problem.

SELECT pageid, title, section.name, category.name, subcat.name,
division.name, subdiv.name
FROM page
LEFT JOIN(section, category, subcat, division, subdiv)
ON (section.section id = page.sectionid AND
category.categoryid = page.categoryid AND
subcat.subcatid = page.subcatid AND
division.divisionid = page.divisionid AND
subdiv.subdivid = page.subdivid)
WHERE authorid=$seq

The errorr occurrs when I attempt to join the tables after the 'ON'
statement.
Thanks for any help

Oct 7 '06 #1
2 1033
ON (section.section id
I think must be as:
ON (section.sectionid

Oct 7 '06 #2
Nancy wrote:
I keep getting a syntax errorr with this code and having problems
figuring out the problem.

SELECT pageid, title, section.name, category.name, subcat.name,
division.name, subdiv.name
FROM page
LEFT JOIN(section, category, subcat, division, subdiv)
ON (section.section id = page.sectionid AND
category.categoryid = page.categoryid AND
subcat.subcatid = page.subcatid AND
division.divisionid = page.divisionid AND
subdiv.subdivid = page.subdivid)
WHERE authorid=$seq

The errorr occurrs when I attempt to join the tables after the 'ON'
statement.
Thanks for any help
You might have more luck asking about SQL problems on an SQL group
rather than a PHP one.

But, to have a go - the answer depends on which version of which SQL you
are using.

Because, for example,
LEFT JOIN (table, table, ... )
is not supported in MySQL before V5.0, nor (if I read the documentation
correctly) in any version of PostgresQL.

Colin
Oct 7 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

699 posts views Thread by mike420 | last post: by
22 posts views Thread by Tuang | last post: by
14 posts views Thread by Sandy Norton | last post: by
16 posts views Thread by George Sakkis | last post: by
23 posts views Thread by Carter Smith | last post: by
19 posts views Thread by Nicolas Fleury | last post: by
4 posts views Thread by Jeremy Yallop | last post: by
3 posts views Thread by Manuel | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.