CGollhardt
Mitglied
Hi, habe das Problem, dass ich mir einen MySQL befehl zusammenbasteln möchte, und das Ergebniss sieht auch wie ein MySQL Befehl aus. Ich finde einfach nicht den Fehler:
Ergibt
Folgende Fehlermeldung
Danke für eure Hilfe
PHP:
$building_befehl = 'CREATE TABLE buildings ( userID INTEGER,';
foreach ($buildings as $nr => $building) {
$building_befehl.= ' '. $nr . ' TINYINT NOT NULL DEFAULT "0",';
}
$building_befehl.= ' PRIMARY KEY (userID) )';
Code:
CREATE TABLE buildings ( userID INTEGER, 1 TINYINT NOT NULL DEFAULT "0", 2 TINYINT NOT NULL DEFAULT "0", 3 TINYINT NOT NULL DEFAULT "0", 4 TINYINT NOT NULL DEFAULT "0", 5 TINYINT NOT NULL DEFAULT "0", 6 TINYINT NOT NULL DEFAULT "0", 7 TINYINT NOT NULL DEFAULT "0", 8 TINYINT NOT NULL DEFAULT "0", 9 TINYINT NOT NULL DEFAULT "0", 10 TINYINT NOT NULL DEFAULT "0", 11 TINYINT NOT NULL DEFAULT "0", 12 TINYINT NOT NULL DEFAULT "0", 13 TINYINT NOT NULL DEFAULT "0", PRIMARY KEY (userID) )
Folgende Fehlermeldung
Code:
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '1 TINYINT NOT NULL DEFAULT "0", 2 TINYINT NOT NULL DEFAULT "0",
Danke für eure Hilfe