function endHandler($parser, $name)
 {
     global $Count, $arData, $Name, $CountNodes;
     //debug
     //echo "$Count.$name\n";
     $Node = $this->CVSNode;
     if (preg_match("/\\b{$Node}\\b/i", $name)) {
         echo "\n({$CountNodes})Class_xml2mysql:(CurrentNode:({$Node}),MyNode:({$name})-> Inserting:[[";
         //insert mysql data
         $LastID = fun_MySQL_Insert_Data($this->DB, $this->New_Table, $arData);
         $arData = "";
         //reset this var for new node
         //add custom field on insert of data, so to mark it for other uses
         if ($this->AddCustomField) {
             $AddCustomField = $this->AddCustomField;
             $ID_Name = fun_Mysql_getPrimaryKeyColumn($this->DB, $this->New_Table, $OtherDBConn = "");
             $arData[$ID_Name] = "{$LastID}";
             $arData[$AddCustomField] = "1";
             fun_Mysql_Update_Data($this->DB, $this->New_Table, $arData, $ID_Name = "", $rtnError = "");
             $arData = "";
         }
         echo "]]\n";
         $CountNodes++;
     }
 }
示例#2
0
 private function fun_NWMLS_saveHistory($My_DB, $My_Table, $arData, $ID_Name, $rsID)
 {
     echo "Updating History[[";
     $My_Table = "history_{$My_Table}";
     $arData[$ID_Name] = $rsID;
     //ownerid of the history record
     unset($arData['ImportID']);
     //don't need this column
     unset($arData['LastUpdated']);
     //don't need this column
     if ($arData) {
         $arData['DateCreated'] = strtotime("now");
         fun_MySQL_Insert_Data($My_DB, $My_Table, $arData, $New_Table_ID = "");
         //make sure the history tables are optimized so they don't waste space
         //fun_Mysql_Optimize_Columns($My_DB, $My_Table, $Test_HowMany_Rows=1000);
     }
     echo "]]Updating History\n";
 }