ericburnard Posted August 7, 2011 Share Posted August 7, 2011 Hi there, have been trying to work this out for a while now but am really stumped so i need some help. Just to keep it easy i have a table with 4 columns id name nameid man/woman 0 barry 1 man 1 barry 1 man 2 george 2 man 3 barry 1 man Basicly what i want to know is how can i my query output barry and george and not barry, barry, George and barry. Im so sure that this is simple but its early in the morning and its annoying me greatly now! I have the man/woman value coming in via a $_get function if this helps at all Thanks a million Eric Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted August 7, 2011 Share Posted August 7, 2011 you will probably want to use the GROUP BY clause here, $sql = "SELECT name FROM table GROUP BY name"; or even $sql = "SELECT DISTINCT name FROM table"; Quote Link to comment Share on other sites More sharing options...
ericburnard Posted August 7, 2011 Author Share Posted August 7, 2011 Nice and easy thank you very much! 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.