Refinement 1: I want to limit the output on the homepage so that it never shows more than the next two upcoming shows.
Refinement 2: The date and time for each show is currently formatted as follows: 5/1/2009 @ 04:00:00. I would like to change this to: May 1, 2009 @ 4:00pm.
Refinement 3: If no future shows are scheduled, I would like to post a message that says 'No events are currently scheduled".
I suspect that the changes I need are not that difficult to come by. It is just (again) that I am very new to all of this. Thanks in advance for any input.
Code: Select all
<?php
// Make an MySQL Connection
mysql_connect("server", "username", "password") or die(mysql_error());
mysql_select_db("database name") or die(mysql_error());
// Get all the data from the "example" table
$result = mysql_query("SELECT * FROM table")
or die(mysql_error());
echo "<table border='0'>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of the specified rows into a table
echo "<tr><td>";
echo"<h4>";
echo $row['m']. "/". $row['d']. "/". $row['y']. " @ " .$row['start_time'];
echo"</h4>";
echo "</td></tr>";
echo "<tr><td>";
echo $row['title'];
echo "<tr><td> </td></tr>"; //This places a blank row between events.
echo "</td></tr>";
}
echo "</table>";
?>