while ($a < $restore['anzahl_zeilen'] && !$restore['fileEOF'] && !$restore['EOB']) {
     xtc_set_time_limit(0);
     $sql_command = get_sqlbefehl();
     //Echo $sql_command;
     if ($sql_command > '') {
         if (!RESTORE_TEST) {
             $res = mysqli_query($connection, $sql_command);
             if ($res === false) {
                 // Bei MySQL-Fehlern sofort abbrechen und Info ausgeben
                 $meldung = @mysqli_error($connection);
                 if ($meldung != '') {
                     die($sql_command . ' -> ' . $meldung);
                 }
             }
         } else {
             protokoll($sql_command);
         }
     }
     $a++;
 }
 $restore['offset'] = $restore['compressed'] ? gztell($restore['filehandle']) : ftell($restore['filehandle']);
 $restore['compressed'] ? gzclose($restore['filehandle']) : fclose($restore['filehandle']);
 $restore['aufruf']++;
 $tabellen_fertig = $restore['table_ready'] > 0 ? $restore['table_ready'] : '0';
 $table_ok = 'Tabellen wiederhergestellt: ' . $tabellen_fertig . '<br><br>Aktuell in Bearbeitung: ' . $restore['actual_table'] . '<br><br>Seitenaufrufe: ' . $restore['aufruf'];
 $_SESSION['restore'] = $restore;
 //$restore['fileEOF'] = true;
 if ($restore['fileEOF']) {
     //FERTIG;
     $info_wait = '';
     $info_text = TEXT_INFO_DO_RESTORE_OK;
예제 #2
0
function submit_create_action($sql)
{
    global $connection;
    //executes a create command
    $tablename = get_tablename($sql);
    /*
    if (strtoupper(substr($sql,0,16))=='CREATE ALGORITHM')
    {
    	// It`s a VIEW. We need to substitute the original DEFINER with the actual MySQL-User
    	$parts=explode(' ',$sql);
    	for ($i=0,$count=sizeof($parts);$i<$count;$i++)
    	{
    		if (strtoupper(substr($parts[$i],0,8))=='DEFINER=')
    		{
    			global $config;
    			$parts[$i]='DEFINER=`'.$config['dbuser'].'`@`'.$config['dbhost'].'`';
    			$sql=implode(' ',$parts);
    			$i=$count;
    		}
    	}
    }
    */
    if (!RESTORE_TEST) {
        $res = @mysqli_query($connection, $sql);
        if ($res === false) {
            // erster Versuch fehlgeschlagen -> zweiter Versuch - vielleicht versteht der Server die Inline-Kommentare nicht?
            $sql = del_inline_comments($sql);
            $res = @mysqli_query($connection, downgrade($sql));
            if ($res === false) {
                // wieder nichts. Ok, haben wir hier einen alten MySQL-Server 3.x oder 4.0.x?
                // versuchen wir es mal mit der alten Syntax
                $res = @mysqli_query($connection, downgrade($sql));
            }
        }
        if ($res === false) {
            // wenn wir hier angekommen sind hat nichts geklappt -> Fehler ausgeben und abbrechen
            //SQLError($sql,mysqlNOTINUSE_error());
            die("<br>Fatal error: Couldn't create table or view `" . $tablename . "´");
        }
    } else {
        protokoll($sql);
    }
    return $tablename;
}