$bsql = "CREATE TABLE Productions_temp (\n\t\tProductionID INT NOT NULL,\n\t\tEventDate DATETIME,\n\t\tEventID INT,\n\t\tOpponentEventID INT,\n\t\tVenueID INT,\n\t\tShortNote CHAR(100),\n\t\tMinCost CHAR(16),\n\t\tMaxCost CHAR(16),\n\t\tPRIMARY KEY (ProductionID)\n\t) ENGINE MyISAM";
$query_result = mysql_query($bsql) or die('CREATE TABLE Productions_temp failed: ' . mysql_error());
print_message("Done.");
// create client object
print_message("Getting Productions from {$serverpath}");
//set soap Action
$method = 'GetAllProductions';
$soapAction = $namespace . $method;
$num_productions_returned = 0;
$soapclient = new SoapClient($serverpath, array("trace" => 1));
$soapclient->timeout = 1500;
$soapclient->response_timeout = 1500;
$param = array('SecurityToken' => "{$securitytoken}");
print_message("ImportProductionsFromWS: Invoking {$method} web method..... ");
try {
    $result = $soapclient->GetAllProductions($param);
    print_message("ImportProductionsFromWS: Done Calling {$soapAction}.");
    $xmlString = preg_replace("/(<\\/?)(\\w+):([^>]*>)/", "\$1\$2\$3", trim($soapclient->__getLastResponse()));
    try {
        libxml_use_internal_errors(true);
        $soap_root = new SimpleXMLElement($xmlString);
        $data = $soap_root->soapBody->GetAllProductionsResponse->GetAllProductionsResult->ROOT->DATA;
        foreach ($data->row as $production) {
            $attrib = $production->attributes();
            $num_productions_returned++;
            $pid = $attrib->ProductionID;
            $edate = tnow_date_to_mysqldate($attrib->EventDate);
            $eid = $attrib->EventID;
            $oeid = $attrib->OpponentEventID;
            $vid = $attrib->VenueID;
            $snote = mysql_escape_string($attrib->ShortNote);