Archive by year

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

shawngoldw
Forum Contributor
Posts: 212
Joined: Mon Apr 05, 2010 3:38 pm

Re: Archive by year

Post by shawngoldw »

Well how ar you getting and setting the year?
aghast
Forum Newbie
Posts: 16
Joined: Wed Jul 28, 2010 3:22 pm

Re: Archive by year

Post by aghast »

shawngoldw wrote:Well how ar you getting and setting the year?

Okay, I got it working. It's now paging within the year. To do so I had to add WHERE YEAR(`date`) = '$year'"), 0); to the record count. Now I just need to make it so that the next button gos on to the next year once there are no more rows in the current year. not sure how to implement it. this is what I have.

Code: Select all


if ($current_page === $last_page){
	$year = $year+1;

        echo " <a href='index.php?year=$year&start=$next'>Next</a>";
}   
but it's not working
shawngoldw
Forum Contributor
Posts: 212
Joined: Mon Apr 05, 2010 3:38 pm

Re: Archive by year

Post by shawngoldw »

Try with only 2 equal signs. Also print $current_page and $last_page before the if and make sure they are both what you expect them to be.
Post Reply