php help

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
nachoman316
Forum Newbie
Posts: 12
Joined: Sat Apr 11, 2009 6:40 am

php help

Post by nachoman316 »

Hello I am new to the forums and I am looking for a bit of help with a php mysql site I am developing.

I have a list of musical artists and dates on which they are playing but I would like to have a programme list that lists the artists and dates they are playing by the next date that is coming up.

ie: Motorhead playing 13th april 2009.

ie: Slipknot playing 20th april 2009.

So once the motorhead gig was past the list would update and Slipknot would be top if the list.

Any Ideas on how to achieve this.
tech603
Forum Commoner
Posts: 84
Joined: Thu Mar 19, 2009 12:27 am

Re: php help

Post by tech603 »

You would want to have your page load and compare the datenow to the dates in the database then have it display the data by date in ascending order.

Example:

Code: Select all

 
<?php
 
$result = mysql_query("SELECT artist, showtime FROM shows WHERE showtime >= now() ORDER BY showtime ASC");
 
/*list results*/
 
?>
 
 
Something like that would work, but that is a quick example to help point you in the right direction.

hope that helps
nachoman316
Forum Newbie
Posts: 12
Joined: Sat Apr 11, 2009 6:40 am

Re: php help

Post by nachoman316 »

Fantastic thanks very much.

Nachoman
Post Reply