Forum Moderators: coopster
this is my code so far:
SELECT DISTINCT month(date_written) as month, year(date_written) as year, UNIX_TIMESTAMP(date) as date
FROM news
WHERE accept = 1
AND month(date_written) IN(1,2,3,4,5,6,7,8,9,10, 11)
AND year(date_written) = 2003
ORDER BY date_written desc
unfortunately this returns an array with 11 entries for november, 10 for october, 13 for september, etc (i.e. the number of stories published in each month) instead of a an array of individual links to each month (11 to be exact ;).
i thought DISTINCT might stop this, but it doesn't? i've been staring at this for quite a while now, and would much appreciate some help if poss.
many thanks
<added> sorry... doh! i just realised distinct can only be used with one record - and actually i only need to select the month, the year nd the date are superfluous...
oh well problem solved ;-)