Racing Australia
$db database successfully!";
}
$query = sprintf("SELECT * FROM horses
WHERE race_date >= %s
ORDER BY race_date, venue, race;", $conn->quote(date("Y-m-d")));
$stmt = $conn->query($query);
// $r = $stmt->fetch(PDO::FETCH_ASSOC);
$table_head = <<
| id |
venue |
race_date |
race |
horse |
TABLEHEAD;
echo( $table_head );
$new_venue = '';
$new_day = '';
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) : ?>
' . htmlspecialchars($row['race_date']) . '';
echo $table_head;
} else if ( $new_venue != '' && $new_venue != $row['venue'] ) {
echo $table_foot;
echo $table_head;
$new_venue = $row['venue'];
}
?>
|
|
|
|
|
TABLEFOOT;
echo $table_foot;
}catch (PDOException $e){
// report error message
echo $e->getMessage();
}
?>