nita Posted May 20, 2007 Share Posted May 20, 2007 Hallo I need some help on spotting a bug or another solution in the following mysql query: i have table recipecat and columns - id, group, name... $result = mysql_query("SELECT * FROM recipecat WHERE group='Menuideas' ORDER BY name") or die(mysql_error()); while($row = mysql_fetch_array( $result )) { echo "<A href='menuideas.php?cat=$row[name]'>$row[name]</a><br>"; } getting following error from the browser: 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='Menuideas' ORDER BY name' at line 1 My php/mysql version is phpMyAdmin 2.7.0-pl1 MySQL 4.0.24 I have been using similar form before with no problems, there mus be something wrong i do, i cant spot it. Thanks a lot for your advice Nita Quote Link to comment https://forums.phpfreaks.com/topic/52189-solved-mysql-query-problem/ Share on other sites More sharing options...
nita Posted May 20, 2007 Author Share Posted May 20, 2007 i tried to do where like method $result = mysql_query("SELECT * FROM recipecat WHERE group LIKE '%Menuideas%' ORDER BY name") or die(mysql_error()); bring the same result im stuck on this one ! any one can Help? Thnaks ! Quote Link to comment https://forums.phpfreaks.com/topic/52189-solved-mysql-query-problem/#findComment-257388 Share on other sites More sharing options...
nita Posted May 20, 2007 Author Share Posted May 20, 2007 column name group (word group is reserved in php) solution - i had change name of the column works ok ! Quote Link to comment https://forums.phpfreaks.com/topic/52189-solved-mysql-query-problem/#findComment-257394 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.