scmeeker Posted August 9, 2010 Share Posted August 9, 2010 I can't figure out why I keep getting a syntax error with this part of the code? Am I missing something? Thanks! $get_group = mysql_query("SELECT group FROM artist WHERE username = '".$_GET["username"]."'") or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/210174-keep-getting-syntax-error/ Share on other sites More sharing options...
trq Posted August 9, 2010 Share Posted August 9, 2010 What is the exact error? Link to comment https://forums.phpfreaks.com/topic/210174-keep-getting-syntax-error/#findComment-1096809 Share on other sites More sharing options...
scmeeker Posted August 9, 2010 Author Share Posted August 9, 2010 Here is the error: 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 'group FROM artist' at line 1 Link to comment https://forums.phpfreaks.com/topic/210174-keep-getting-syntax-error/#findComment-1096830 Share on other sites More sharing options...
JasonLewis Posted August 9, 2010 Share Posted August 9, 2010 The name 'group' is a reserved MySQL word. There is a list of reserved words on the MySQL website. Take care when using these words for column names. Link to comment https://forums.phpfreaks.com/topic/210174-keep-getting-syntax-error/#findComment-1096834 Share on other sites More sharing options...
Pikachu2000 Posted August 9, 2010 Share Posted August 9, 2010 I suspect 'group' is a reserved word. Enclose it in backticks and try it again: `group` Link to comment https://forums.phpfreaks.com/topic/210174-keep-getting-syntax-error/#findComment-1096835 Share on other sites More sharing options...
scmeeker Posted August 9, 2010 Author Share Posted August 9, 2010 Thanks for the help! Link to comment https://forums.phpfreaks.com/topic/210174-keep-getting-syntax-error/#findComment-1097065 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.