Forum Moderators: coopster
On the page I would like to loop through and show an image for each year and under that image have all the news for that year. The problem I am having is that the image repeats itself for each entry. I would like the image to show up just one time and then all the news for that year under it. And then continue on to the next year and so forth.
Is there a way to write this in one statement instead of several? what logic should I use in this approach?
I will recommend you to post your code and mysql query you are using that will give me a more clear idea of your current logic and how we can improve on your current code.
check to see all years of items in db
they are 2008 2007 2006 2005 2004
then echo img src graphic2008.jpg and then echo all entries for that year, continue on and echo graphic2007.jpg and all entires for that year.
I am wondering if I should use a for loop? or a foreach?
[w3schools.com...]