Jump to content

Date / Row Display


recbass

Recommended Posts

I'm a newbie at PHP and have been trying to teach myself to do certain things. There is one thing I just don't know how to go about doing.

I want to set up a script for a band so they can list their upcoming show dates. I want the upcoming dates to appear on the upcoming page, and dates that have passed to display on an archives page. This would also make it so that the upcoming page would seem updated after each show automatically.

I have all the coding to add dates, display all dates, edit dates, and etc... I just don't know how to seperate them so they can display on seperate pages. Any ideas?

Thanks in advance.
Link to comment
https://forums.phpfreaks.com/topic/30812-date-row-display/
Share on other sites

So you're looking for like a pagnation script but modify it for a date range?

This is a little tutorial in pagnation: http://www.phpfreaks.com/tutorials/43/0.php

You could modify it to work with dates instead of page limits.  So you can make each page a month.
Link to comment
https://forums.phpfreaks.com/topic/30812-date-row-display/#findComment-142064
Share on other sites

Thanks for pointing me to that. I'll try to to go through that and see what I can make of it.

I was actually hoping to just have one page dedicated to an "Archive" page and have the dates not show anymore on the "Upcoming" page. Myspace actually does this but without the archive page. All the listings are still there in the user admin area, but aren't visible on the display page. I thought there might be an extremely easy way to do it like an if statement.

if before today's date
etc...
Link to comment
https://forums.phpfreaks.com/topic/30812-date-row-display/#findComment-142153
Share on other sites

How are you storing the dates?  If it's with MySQL, then you could use this for the 'upcoming' page:
[code]
<?php
$date = date();
$query = mysql_query(SELECT * FROM table WHERE date > $date);

echo "<h1>Upcoming Tour Dates</h1>";
echo "<table border=1>";
echo "<tr>";
echo "<td>Date</td>";
echo "<td>Venue</td>";
while($row = mysql_fetch_array($query))
{
echo "<tr>";
echo "<td>".$row['date']."</td>";
echo "<td>".$row['venue']."</td>";
echo "</tr>";
}
echo "</table>";
[/code]
You can customise it to fit eactly what you need (extra columns etc.)
Link to comment
https://forums.phpfreaks.com/topic/30812-date-row-display/#findComment-142166
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.