# Building something for work and need help

**URL:** <https://www.phphelp.com/t/building-something-for-work-and-need-help/10125>\
**Category:** Beginners - Learning PHP\
**Created:** [July 17, 2007, 10:19am UTC](https://www.phphelp.com/t/building-something-for-work-and-need-help/10125 "2007-07-17T10:19:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewlondon](https://www.phphelp.com/letter_avatar_proxy/v4/letter/a/958977/32.png) [@andrewlondon](https://www.phphelp.com/u/andrewlondon)\
**Post date:** [July 17, 2007, 10:19am UTC](https://www.phphelp.com/t/building-something-for-work-and-need-help/10125/1 "2007-07-17T10:19:07Z")

</div>

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…

Andrew

---

<div class="post-metadata">

**Author:** ![andrewlondon](https://www.phphelp.com/letter_avatar_proxy/v4/letter/a/958977/32.png) [@andrewlondon](https://www.phphelp.com/u/andrewlondon)\
**Post date:** [July 17, 2007, 10:36am UTC](https://www.phphelp.com/t/building-something-for-work-and-need-help/10125/2 "2007-07-17T10:36:13Z")

</div>

It needs to function something like the page below…

[http://www.eurogamer.net/releases.php](http://www.eurogamer.net/releases.php)

---

<div class="post-metadata">

**Author:** ![Ragster00](https://www.phphelp.com/letter_avatar_proxy/v4/letter/r/a9adbd/32.png) [@Ragster00](https://www.phphelp.com/u/Ragster00)\
**Post date:** [July 17, 2007, 4:01pm UTC](https://www.phphelp.com/t/building-something-for-work-and-need-help/10125/3 "2007-07-17T16:01:53Z")

</div>

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.
