This block of code is ADO connection code used only for demonstration purposes
     objConn is an ADO object we use here for demonstration purposes.
 */
$saveHandler = new EBASaveHandler();
$saveHandler->ProcessRecords();
// Make a MySQL Connection
mysql_connect() or die(mysql_error());
mysql_select_db("nitobi_testdb_v1") or die(mysql_error());
// ********************************************************** '
// Begin by processing our inserts
// ********************************************************** '
$insertCount = $saveHandler->ReturnInsertCount();
if ($insertCount > 0) {
    // Yes there are INSERTs to perform...
    for ($currentRecord = 0; $currentRecord < $insertCount; $currentRecord++) {
        $myQuery = "INSERT INTO tblorders (CustomerID, ProductName, OrderDate, ShippedDate) VALUES (" . "'" . $saveHandler->ReturnForeignKeyValue($currentRecord) . "'," . "'" . $saveHandler->ReturnInsertField($currentRecord, "ProductName") . "', " . "'" . $saveHandler->ReturnInsertField($currentRecord, "OrderDate") . "', " . "'" . $saveHandler->ReturnInsertField($currentRecord, "ShippedDate") . "'" . "); ";
        // Now we execute this query
        mysql_query($myQuery);
    }
}
// ********************************************************** '
// Continue by processing our updates
// ********************************************************** '
$updateCount = $saveHandler->ReturnUpdateCount();
if ($updateCount > 0) {
    // Yes there are UPDATEs to perform...
    for ($currentRecord = 0; $currentRecord < $updateCount; $currentRecord++) {
        $myQuery = "UPDATE tblorders SET " . "ProductName\t\t= '" . $saveHandler->ReturnUpdateField($currentRecord, "ProductName") . "', " . "OrderDate\t\t\t= '" . $saveHandler->ReturnUpdateField($currentRecord, "OrderDate") . "', " . "ShippedDate\t\t\t= '" . $saveHandler->ReturnUpdateField($currentRecord, "ShippedDate") . "'" . "WHERE OrderID \t= " . $saveHandler->ReturnUpdateField($currentRecord) . "" . ";";
        // Now we execute this query
        mysql_query($myQuery);
    }