Race Events

[insert_php]

if ($_POST[‘submitted’] == “true”) {
$result = $_POST[‘field’];
$result_explode = explode(‘|’, $result);

require_once( ABSPATH . WPINC . ‘/mysqli_connect.php’ );

// Make the query:

$q = “SELECT * from tb_program where date = ‘$result_explode[0]'”;

$r = @mysqli_query ($dbc, $q); // Run the query

//Count the number of records:

$num =@mysqli_num_rows($r);

if ($num>0) { // If it ran OK, display the records.

// Table header.

echo “

$result_explode[1]

“;

echo ‘

‘;

// Fetch and print all the records

while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) {

echo ‘

‘;
} // End of WHILE loop

echo ‘

Event No. Event Closes
1 ‘ . $row[‘event1’] . ‘ 8:20am
2 ‘ . $row[‘event2’] . ‘ 8:50am
3 ‘ . $row[‘event3’] . ‘ 8:50am
4 ‘ . $row[‘event4’] . ‘ 8:50am
5 ‘ . $row[‘event5’] . ‘ 9:00am
6 ‘ . $row[‘event6’] . ‘ 9:00am
7 ‘ . $row[‘event7’] . ‘ 9:10am
8 ‘ . $row[‘event8’] . ‘ 9:10am
9 ‘ . $row[‘event9’] . ‘ 9:10am
10 ‘ . $row[‘event10’] . ‘ 9:10am

‘; // Close the table.

//This is the end of all the loops and Else Ifs additional Output tables should be above this.

mysqli_free_result($r); // Free up the resources.

} else {

//Public message:
echo “

$result_explode[1]

“;
echo ‘

No Swim Club

‘;

// Debug messgae:

// echo ‘

‘ . mysqli_error($dbc) . ‘

Query: ‘ . $q . ‘

‘;

}

mysqli_close($dbc); // Close the database connection.

} else {

//Public message:

echo ‘

You have access this page incorrectly

‘;

}

[/insert_php]