hi
Es gibt in MySQL Single Quotes ' sowie Backticks ` und Double Quotes "
Es ist mir aber nicht ganz klar wo ich welche verwenden darf.
Folgendes funktionierte nicht:
mysql> INSERT INTO foo
(id
, foo
, bar
) VALUES (``, abc
, def
);
ERROR 1054: Unknown column '' in 'field list'
mysql>
In der Annahme dass ` Probleme machte ging ich her und nahm '
mysql> INSERT INTO 'foo' ('id', 'foo', 'bar') VALUES ('', 'abc', 'def');
ERROR 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 ''foo' ('id', 'foo', 'bar') VALUES ('', 'abc', 'def')' at line 1
mysql>
Nur " gehen auch nicht:
mysql> INSERT INTO "foo" ("id", "foo", "bar") VALUES ("", "abc", "def");
ERROR 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 '"foo" ("id", "foo", "bar") VALUES ("", "abc", "def")' at line 1
mysql>
Wo soll ich welche verwenden?
Derzeit sind meine Test-Felder noch alle durchgehende Wörter und würden
keine Single Quotes, Backticks und Double Quotes brauchen.
aber es kommen bald Werte und Feldnamen mit
LEERZEICHEN und diversen Sonderzeichen da muss ich sehrwohl was machen.
^^^^^^^^^^^ ^^^^^^^^^^^^^
Auch das hier ist unklar:
PRIMARY KEY (id),
UNIQUE INDEX id (id)
Welche ` oder ' oder " braucht man hier?
Dankende Grüße!
Schönen Tag noch wünscht
Euer AhANiBoy