violinrocker Posted March 20, 2011 Share Posted March 20, 2011 i want to fetch contributors in adding certain articles... so its like select contributors from table where id=id the table looks like this. title contributor ---------------------------------- art1 me art2 me art3 you art4 me art5 you I then need to echo the contributors... what do i do so that it echoes one name only once, no duplicates... thanks. I tried searching google but im not sure about my keywords Quote Link to comment https://forums.phpfreaks.com/topic/231182-do-not-repeat-same-names-from-fetched-rows/ Share on other sites More sharing options...
floridaflatlander Posted March 20, 2011 Share Posted March 20, 2011 Can you use a GROUP BY as in GROUP BY contributor ? You use it just before ORDER BY if you have one. Quote Link to comment https://forums.phpfreaks.com/topic/231182-do-not-repeat-same-names-from-fetched-rows/#findComment-1189926 Share on other sites More sharing options...
violinrocker Posted March 20, 2011 Author Share Posted March 20, 2011 tnx, its the first time i heard that statement (or i wasnt paying any attention to it)... i googled it and I think it should solve my problem... Tnx Quote Link to comment https://forums.phpfreaks.com/topic/231182-do-not-repeat-same-names-from-fetched-rows/#findComment-1189927 Share on other sites More sharing options...
sasa Posted March 20, 2011 Share Posted March 20, 2011 you can use DISTINCT statement too select DISTINCT contributors from table where id=id Quote Link to comment https://forums.phpfreaks.com/topic/231182-do-not-repeat-same-names-from-fetched-rows/#findComment-1189973 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.