mabu: *.sql Datei ausführen

Beitrag lesen

Hab das jetzt probiert, aber irgendwie funzts nicht...

Das ist mein Script:

<?PHP
$db_handle = mysql_connect
 ("localhost", "root", "");
$success = mysql_select_db
 ("scriptstest");
$file = fopen("file.txt","r");
$i=0;
while($zeile = fgetcsv($file,10000)) {
 $erfolg=mysql_query("$zeile[0]",$db_handle);
 if($erfolg) echo "Zeile ".$i." erfolgreich!<br>";
 else echo "<font color=red>Zeile ".$i." Fehler!</font><br>";
 $i++;
}

?>

Und das ein Teil der Datei:

DROP TABLE IF EXISTS mad\_settings;
CREATE TABLE mad\_settings (
  title text NOT NULL,
  color\_background text NOT NULL,
  color\_tableheader text NOT NULL,
  color\_table1 text NOT NULL,
  color\_table2 text NOT NULL,
  color\_textheader text NOT NULL,
  color\_texttable text NOT NULL,
  color\_text text NOT NULL,
  font\_face text NOT NULL,
  font\_sizeheader text NOT NULL,
  font\_size text NOT NULL,
  color\_tableborder text NOT NULL,
  table\_size text NOT NULL,
  color\_link text NOT NULL,
  admin\_pw text NOT NULL
) TYPE=MyISAM;

Es wird bei allen Zeilen Fehler gemeldet, außer bei den DROP TABLE. weil ja nicht alles in der selben Zeile steht, was zusammen gehört. Wenn ich es zusammenschreibe, gehts aber auch nicht...

Kann man die andere Möglichkeit vielleicht doch erklären oder hab ich einen Fehler gemacht?