Racing Australia

$db database successfully!"; } try { $date = new DateTime("now", new DateTimeZone('Australia/Melbourne')); } catch (Exception $e) { echo $e->getMessage(); exit(1); } $query = sprintf("SELECT * FROM horses JOIN race_program ON horses.race_date = race_program.race_date AND horses.venue = race_program.venue AND horses.race = race_program.race WHERE horses.race_date >= %s ORDER BY horses.race_date, horses.venue, horses.race, horses.horse_no;", $conn->quote($date->format('Y-m-d'))); $stmt = $conn->query($query); /* $r = $stmt->fetch(PDO::FETCH_ASSOC); print "
" ;
		print_r($r);
		print "
"; */ $query = sprintf("SELECT * FROM race_program WHERE race_date >= %s AND torn = TRUE ORDER BY race_date, venue, race DESC;", $conn->quote($date->format('Y-m-d'))); $stmt2 = $conn->query( $query ); ?> fetch( PDO::FETCH_ASSOC ) ) : ?>
Races featured on Torn
venue state date race start utc
= %s ORDER BY race_date, venue, race DESC;", $conn->quote($date->format('Y-m-d'))); $stmt3 = $conn->query( $query ); ?> fetch( PDO::FETCH_ASSOC ) ) : ?>
All races
venue state date race start utc
TABLEHEAD; $table_foot = << TABLEFOOT; echo( $table_head ); $new_venue = ''; $new_day = ''; $img = '48px-Commons-emblem-success.svg.png'; $img = <<<'TAG' File:Commons-emblem-success.svg TAG; $head_displayed = False; while($row = $stmt->fetch(PDO::FETCH_ASSOC)) : ?> '; echo '

' . htmlspecialchars($row['race_date']) . '

'; echo '
venue state date race start utc horse torn
'; $new_day = $row['race_date']; $head_displayed = True; } } else { $new_day = $row['race_date']; } if ( $new_venue != '' ) { if ( $new_venue != $row['venue'] ) { echo $table_foot; echo $table_head; $new_venue = $row['venue']; } } else { $new_venue = $row['venue']; } ?>
getMessage(); } ?>