Page 1 of 1

php help

Posted: Sat Apr 11, 2009 6:47 am
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.

Re: php help

Posted: Sat Apr 11, 2009 10:26 am
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

Re: php help

Posted: Sat Apr 11, 2009 1:32 pm
by nachoman316
Fantastic thanks very much.

Nachoman