====== refresh.php ====== Schulen einlesen

Schuldaten importieren

"; print_r($data);echo ""; if (!$data) { echo "Error loading XML\n"; foreach(libxml_get_errors() as $error) { echo "\t", $error->message; } } else { $db->query("truncate $strDB"); $numCounter=1; foreach ($data as $key => $value) { //DEBUG: echo $key ." => ".print_r($value) ."
"; $strSQL="insert into $strDB set "; foreach ($value as $key2 => $value2) { if ($key2=="E-Mail") $key2="E_Mail"; $strSQL .= $key2 ."='". addslashes($value2) ."',"; } $strSQL=rtrim($strSQL,","); //DEBUG: echo $strSQL."

"; if ($numCounter%100==0) echo "."; $numCounter++; try { $db->query($strSQL); } catch (PDOException $e) { echo $e->getMessage(); } } echo "

". $numCounter. " Datensätze eingelesen

"; } } ?>

zurück