General Kane Posted December 4, 2009 Share Posted December 4, 2009 How do I loop the members who have a special text in one of the table rows in members table ? Like on members file but only the ones with the text "special" in row group. Quote Link to comment https://forums.phpfreaks.com/topic/184016-help/ Share on other sites More sharing options...
raytri Posted December 4, 2009 Share Posted December 4, 2009 You'll get more replies if your subject line is more descriptive. To make sure I understand correctly: You have a column in your table (Let's call it "Notes") that you use to label some members with the text "special." You want to select only those "special" members, and loop through them. The query would look like this: $query = mysql_query("SELECT * FROM Members WHERE Notes='special' ") This will return all the members marked "special". You can then fetch the array and loop through it as you would anything else. Quote Link to comment https://forums.phpfreaks.com/topic/184016-help/#findComment-971551 Share on other sites More sharing options...
General Kane Posted December 4, 2009 Author Share Posted December 4, 2009 That didnt work, it says "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'=Kanes Dwarfs'' at line 1" Quote Link to comment https://forums.phpfreaks.com/topic/184016-help/#findComment-971579 Share on other sites More sharing options...
Zane Posted December 4, 2009 Share Posted December 4, 2009 'group'=Kanes Dwarfs'" should be `group`='Kanes Dwarfs'" Notice the difference in 'group' and `group`. This is required since group is a reserved MySQL word. Otherwise you could just have group by itself without any quotes and also.. Kanes Dwarfs needs to be surrounded with the regular quotes.. Quote Link to comment https://forums.phpfreaks.com/topic/184016-help/#findComment-971592 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.