[insert_php] $conn = mysql_connect(‘localhost’, ‘gtbikers_codeRdr’, ‘bbm_scanning’);
$db = mysql_select_db(‘gtbikers_wpdata’);
$mysqli= new mysqli(‘localhost’, ‘gtbikers_codeRdr’, ‘bbm_scanning’, ‘gtbikers_wpdata’) or die(‘Cannot connect’);

include ‘events.php’;
$befCountQuery = mysql_query(“select count(UserID) as count from ds_event_registration_scanning;”);

if (!$befCountQuery) {
echo “Unable to complete query, check syntax and execution.”;
}
else {
while ($befRow = mysql_fetch_assoc($befCountQuery)) {
$befCount = $befRow[‘count’];
echo “Initial Registrant Count is: ” . $befCount . “

“;
}
}

if (!$mysqli->query(“CALL buildRegScanTable();”)) {
echo “CALL failed: (” . $mysqli->errno . “) ” . $mysqli->error;
}
else {
echo “Registrant synchronization complete.

“;
mysql_free_result();
$afterResult = mysql_query(“select count(UserID) as count2 from ds_event_registration_scanning;”);
if (!$afterResult) {
die(‘Invalid query: ‘ . mysql_error());
}
else {
while ($afterRow = mysql_fetch_assoc($afterResult)) {
$afterCount = $afterRow[‘count2’];
$newRegistrants = $afterCount – $befCount;
echo “Post Registrant Count is: ” . $afterCount . “. There were ” . $newRegistrants . ” added.”;
}
}
}
[/insert_php]