Alexhoward Posted March 22, 2008 Share Posted March 22, 2008 hello! $query2="SELECT link FROM links WHERE group = 'shopping' and subgroup = 'mall'"; getting 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 = 'shopping' and subgroup = 'mall'' at line 1 this works fine everywhere else.. can anyone help me? Thanks Quote Link to comment Share on other sites More sharing options...
zackcez Posted March 22, 2008 Share Posted March 22, 2008 I'm not very intelegant when it comes to php at the moment but try: $query2="SELECT link FROM links WHERE group ='shopping' and subgroup ='mall'"; All I could think of . Quote Link to comment Share on other sites More sharing options...
Alexhoward Posted March 22, 2008 Author Share Posted March 22, 2008 OK, why not... i'll give it a go.... but oh no...my servers gone down...! Quote Link to comment Share on other sites More sharing options...
AndyB Posted March 22, 2008 Share Posted March 22, 2008 group is a MySQL reserved word. Don't use reserved words as field or table names. http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html Quote Link to comment Share on other sites More sharing options...
Alexhoward Posted March 22, 2008 Author Share Posted March 22, 2008 ah, OK, so i should change the names of the columns to something like... cat, subcat but i've lost connection with mysql, so it's a waiting game at the mo... Thanks Quote Link to comment 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.