PDA

View Full Version : what am i doing wrong with this query (joins)


sabret00the
12-13-2004, 10:08 PM
SELECT grps.groupid, grps.title, grps.description, grps.approved, user.username, grps_catergories.catid, grps_catergories.title AS catname, grps_setting.image_name, grps_setting.private_posts, grps_setting.moderate_members, grps_setting.hidden_group, grps_grouptext.pagetext AS spew
FROM grps_setting
LEFT JOIN user ON ( user.userid = grps_user.userid )
INNER JOIN grps.groupid = grps_setting.groupid
INNER JOIN grps_grouptext.groupid = grps.groupid
LEFT JOIN grps_catergories ON ( grps_catergories.catid = grps.catid )
WHERE groupid = 3
GROUP BY grps.groupid
ORDER BY grps.groupid DESC

amykhar
12-14-2004, 12:23 AM
what error are you getting?

sabret00the
12-14-2004, 08:53 AM
#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 '.groupid
INNER JOIN grps_grouptext.groupid = grps.groupid
LEFT

i have no idea what that means :(

sabret00the
12-14-2004, 01:39 PM
actually just fixed it by reverting back to left joins, thank yo very much for your help anyway.

Xenon
12-18-2004, 12:59 PM
actually you forgot the table, so instead of:

INNER JOIN grps_grouptext.groupid = grps.groupid
you have to use
INNER JOIN grps_grouptext ON (grps_grouptext.groupid = grps.groupid)

sabret00the
12-18-2004, 01:06 PM
ahhhh thanks stefan :)