Page 1 of 1

Problem Query

Posted: Thu Jun 22, 2006 6:20 pm
by Benjamin
I dunno why this doesn't work, it looks fine to me. Here the echo'd query...

(Bolded for easy reading)


select CommentsIndex.CommentID, CommentsIndex.MemberID, `TimeStamp`, `CommentBody`, `PostCount`, `MemberUsername`, `ImageOne`, `One`, `Two`, `Type`
from `CommentsIndex`
join `Comments`
on (CommentsIndex.CommentID = Comments.CommentID)
join `PostCount`
on (CommentsIndex.MemberID = PostCount.MemberID)
join `Index`
on (CommentsIndex.MemberID = Index.MemberID)
join `Pictures`
on (CommentsIndex.MemberID = Pictures.MemberID)
join `Profile` on (CommentsIndex.MemberID = Profile.MemberID)
where CommentsIndex.CommentID='1199'


Error returned is syntax error near 'Index . MemberID

Posted: Thu Jun 22, 2006 6:23 pm
by RobertGonzalez
All tables and fields exist? That's my first check.

Posted: Thu Jun 22, 2006 6:24 pm
by feyd
index is a keyword.. backticks all around.

Posted: Thu Jun 22, 2006 6:29 pm
by Benjamin
Yeah it needed backticks. For some reason I thought you didn't need backticks when specifying the table.fieldname.