Building something for work and need help

I’ve been asked to create a page for our website at work. All it needs to do is list computer game release dates based on the information in our database.

The thing is, the page needs to be semi intelligent…

I’m asking for help on here because although i’m getting to grips with PHP, i don’t yet know the best way to get certain things done…

Anyway, there will be a page that lists the games released in the current month, a heading for each month and the page will contain all the remaining months of the current year. So for example, the month is July, the page would be laid out as follows

July 2007 Releases:

Blah blah blah

August 2007 Releases:

Blah blah blah

At the bottom of the page will be a link to the next page, this is the same again but for 2008, the idea is to only go until the following year but i’m stuck on how to get this sort of functionallity. How on earth would i get the first page to change to Janurary 2008 when that’s the current year?

Any ideas, hints, tips, please share them…


It needs to function something like the page below…

I would simply do a select by the current year…

$year = date(“Y”);
$q = “SELECT * FROM mytable WHERE DATE_FORMAT(date_field, %Y) = ‘$year’”;

You may need to do some mysql date format stuff. Granted, that is if you are using mysql database.

Then I would have the link to the next year like -

$next_year = date(“Y”, mktime(0, 0, 0, 0, 0, date(“Y”) + 1));
Next Year

Just remember I didn’t try any of this code. Just wrote it off the cuff. Just there to give you some guidance.

Sponsor our Newsletter | Privacy Policy | Terms of Service