Im trying to query a list of dates. I need to show only dates starting from today and ignoring and past dates. I've searched the boards to no luck. Grateful for any help.
Thanks from another newbie in trouble.
<?php
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);
if ($dbc = @mysql_connect ('*****', '*****', '*****')) {
if (!@mysql_select_db ('sr_admin')) {
die ('<p>Could not select the database because: <b>' . mysql_error() . '</b></p>'); }
} else {
die ('<p>Could not connect to MySQL because: <b>' . mysql_error() .
'</b></p>');
}
$query = 'SELECT * FROM show_dates ORDER BY show_date ASC';
if ($r = mysql_query ($query)) {
while ($row = mysql_fetch_array ($r)) {
$show_date = date("m/d/Y", strtotime( $row['show_date'] ) );
print "<p><tr><td>$show_date</td>
<td>{$row['show_city']}, {$row['show_state']}</td>
<td> {$row['show_venue']}</td></tr></p>
\n";
}
} else {
die ('<p>Could not retrieve the data because: <b>' . mysql_error() .
"</b>. The query was $query.</p>");
}
mysql_close();
?>