Forum Moderators: open
portfolio_cats
-id
-cat
portfolio_comments
-id
-portfolio_id
-user_id
-comment
I am using the following select statement:
SELECT portfolio.id, portfolio.img, portfolio.title,portfolio.public,portfolio.descrip, portfolio_cats.cat
FROM `portfolio_cats`
INNER JOIN portfolio ON portfolio_cats.id = portfolio.category
INNER_JOIN portfolio_comments ON portfolio.id = portfolio_comments.portfolio_id
I have tried various variations on this select to try and address the error that i am getting:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER_JOIN portfolio_comments ON portfolio_cats.id = portfolio_comments.portfoli...' at line 4
I have searched books and online postings relating to this multiple Inner Join syntax,
select stuff
from A
inner join B on A.id = B.Aid
inner join C on B.id = C.Bid
So i understand the succession of tables in the innerjoin, can anyone suggest how i might arrange my query? Or help me to understand why it won't work?
Many thanks!
[edited by: Frasnko at 8:47 pm (utc) on April 30, 2007]
SELECT portfolio.id, portfolio.img, portfolio.title,portfolio.public,portfolio.descrip, portfolio_cats.cat
FROM ((`portfolio_cats`
INNER JOIN portfolio ON portfolio_cats.id = portfolio.category)
INNER JOIN portfolio_comments ON portfolio.id = portfolio_comments.portfolio_id)