Bakes Posted March 15, 2009 Share Posted March 15, 2009 SELECT user.data1, user.data2, subgroup.name JOIN subgroup ON (subgroup.id = user.subgroup) JOIN group ON (group.id = subgroup.group) WHERE user.level = 30 AND group.rank = 20 gives me error #1064. I know the problem is that I am querying a joined table, but I am unsure how to fix it, so thought I'd post here. Can anyone show me what my problem is? Quote Link to comment https://forums.phpfreaks.com/topic/149503-solved-selecting-from-a-joined-table/ Share on other sites More sharing options...
Mchl Posted March 15, 2009 Share Posted March 15, 2009 'group' is MySQL's reserved word. http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html Quote Link to comment https://forums.phpfreaks.com/topic/149503-solved-selecting-from-a-joined-table/#findComment-785114 Share on other sites More sharing options...
Bakes Posted March 15, 2009 Author Share Posted March 15, 2009 sorry, I didn't say that I renamed the tables, because the guy who i'm doing this for wants me to release as little as possible (I've done this, for the most part, in Python, but I'm having some trouble with the web interface, and the SQL.) it's actually something more along the lines of pho34_ugroup Quote Link to comment https://forums.phpfreaks.com/topic/149503-solved-selecting-from-a-joined-table/#findComment-785117 Share on other sites More sharing options...
Mchl Posted March 15, 2009 Share Posted March 15, 2009 Error 1064 occurs when you used reserved words as table/column names. Check your query against the list of reserved words. Quote Link to comment https://forums.phpfreaks.com/topic/149503-solved-selecting-from-a-joined-table/#findComment-785119 Share on other sites More sharing options...
Bakes Posted March 15, 2009 Author Share Posted March 15, 2009 ah, I see, I didn't specify a FROM statement. All fixed now Quote Link to comment https://forums.phpfreaks.com/topic/149503-solved-selecting-from-a-joined-table/#findComment-785131 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.