#1064 - You have an error in your SQL syntax
Inviato: 16/11/2012, 17:28
Salve devo poter creare una tabella nel mio DB
CREATE TABLE IF NOT EXISTS 'ordini' (
'id' int(11) NOT NULL AUTO_INCREMENT,
'nome_utente' varchar(255) CHARACTER SET latin1 NOT NULL DEFAULT '',
'cognome_utente' varchar(255) CHARACTER SET latin1 NOT NULL DEFAULT '',
'id_utente' int(11) NOT NULL,
'display_name_utente' varchar(255) CHARACTER SET latin1 NOT NULL,
'email_utente' varchar(255) CHARACTER SET latin1 NOT NULL,
'nome_prodotto' varchar(255) CHARACTER SET latin1 NOT NULL,
'id_prodotto' int(11) NOT NULL,
'prezzo' decimal(11,2) NOT NULL,
'prezzo_scontato' decimal(11,2) NOT NULL,
'quantita' int(11) NOT NULL,
'nome_societa' varchar(255) COLLATE utf8_unicode_ci NOT NULL,
'nome_cliente' varchar(255) COLLATE utf8_unicode_ci NOT NULL,
'cognome_cliente' varchar(255) COLLATE utf8_unicode_ci NOT NULL,
'email_cliente' varchar(255) COLLATE utf8_unicode_ci NOT NULL,
'data' datetime NOT NULL,
PRIMARY KEY ('id')
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
Purtroppo genera l'errore:
#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 ''ordini' ( 'id' int(11) NOT NULL AUTO_INCREMENT, 'nome_utente' varchar(255' at line 1
Versione software: 5.1.65 - MySQL Community Server
Come posso risolvere il problema???
CREATE TABLE IF NOT EXISTS 'ordini' (
'id' int(11) NOT NULL AUTO_INCREMENT,
'nome_utente' varchar(255) CHARACTER SET latin1 NOT NULL DEFAULT '',
'cognome_utente' varchar(255) CHARACTER SET latin1 NOT NULL DEFAULT '',
'id_utente' int(11) NOT NULL,
'display_name_utente' varchar(255) CHARACTER SET latin1 NOT NULL,
'email_utente' varchar(255) CHARACTER SET latin1 NOT NULL,
'nome_prodotto' varchar(255) CHARACTER SET latin1 NOT NULL,
'id_prodotto' int(11) NOT NULL,
'prezzo' decimal(11,2) NOT NULL,
'prezzo_scontato' decimal(11,2) NOT NULL,
'quantita' int(11) NOT NULL,
'nome_societa' varchar(255) COLLATE utf8_unicode_ci NOT NULL,
'nome_cliente' varchar(255) COLLATE utf8_unicode_ci NOT NULL,
'cognome_cliente' varchar(255) COLLATE utf8_unicode_ci NOT NULL,
'email_cliente' varchar(255) COLLATE utf8_unicode_ci NOT NULL,
'data' datetime NOT NULL,
PRIMARY KEY ('id')
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
Purtroppo genera l'errore:
#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 ''ordini' ( 'id' int(11) NOT NULL AUTO_INCREMENT, 'nome_utente' varchar(255' at line 1
Versione software: 5.1.65 - MySQL Community Server
Come posso risolvere il problema???