web_master Posted June 11, 2009 Share Posted June 11, 2009 hi, I got a table and one column is column of the years. Well there is lots of different years in rows but there is a lots of same years. My question is, how can I list years but if in table more than one of the same "year" list only one time. Exaple: in table is: 2008 2008 2008 1976 2007 Listed: 2008 2007 1976 <?php $query_return = mysql_query("SELECT `years` FROM `text` ORDER BY `id`"); while($request = mysql_fetch_array($query_return)) { // } ?> thanxs in advanced, T Link to comment https://forums.phpfreaks.com/topic/161789-solved-query-one-from-all/ Share on other sites More sharing options...
xtopolis Posted June 11, 2009 Share Posted June 11, 2009 SELECT DISTINCT years FROM `text` ORDER BY id Link to comment https://forums.phpfreaks.com/topic/161789-solved-query-one-from-all/#findComment-853638 Share on other sites More sharing options...
web_master Posted June 11, 2009 Author Share Posted June 11, 2009 SELECT DISTINCT years FROM `text` ORDER BY id THNXS!!! Link to comment https://forums.phpfreaks.com/topic/161789-solved-query-one-from-all/#findComment-853644 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.