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.
php help
Moderator: General Moderators
Re: php help
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:
Something like that would work, but that is a quick example to help point you in the right direction.
hope that helps
Example:
Code: Select all
<?php
$result = mysql_query("SELECT artist, showtime FROM shows WHERE showtime >= now() ORDER BY showtime ASC");
/*list results*/
?>
hope that helps
-
nachoman316
- Forum Newbie
- Posts: 12
- Joined: Sat Apr 11, 2009 6:40 am
Re: php help
Fantastic thanks very much.
Nachoman
Nachoman