[Mysql] problema su Foreign Key

Mitttico

Nuovo Utente
26 Gen 2009
3
0
0
Salve a tutti. Ho una tabella che richiama dei dati di altre tabelle.

Ho fatto così:

codice:

CREATE TABLE `Vendita` ( `id_vendita` integer unsigned NOT NULL auto_increment,
`libro` integer unsigned NOT NULL,
`seller` integer unsigned NOT NULL,
`prezzo` double unsigned NOT NULL,
`commento` varchar(200),
`isbn` integer NOT NULL,
`data` date NOT NULL,
`edizione` integer,
`lingua` integer unsigned NOT NULL,
`condizione` integer unsigned NOT NULL,
`eta` integer unsigned NOT NULL,
`formato` integer unsigned NOT NULL,
`copertina` integer unsigned,
`soggetto` integer unsigned,
PRIMARY KEY (`id_vendita`),
FOREIGN KEY (libro) REFERENCES Book(id_book) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (seller) REFERENCES Seller(id_seller) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (lingua) REFERENCES Language(id_language) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (condizione) REFERENCES Condition(id_condition) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (eta) REFERENCES Age(id_age) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (formato) REFERENCES Format(id_format) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (copertina) REFERENCES Binding(id_binding) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (soggetto) REFERENCES Subject(id_subject) ON DELETE CASCADE ON UPDATE CASCADE )



Mi da errore purtroppo e non so perchè...chi mi aiuta???

L'errore è :

[localhost] 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 'Condition(id_condition)
ON DELETE CASCADE
ON UPDATE CASC
 
Discussioni simili
Autore Titolo Forum Risposte Data
S problema con recupero dati tabella mysql PHP 2
Z Problema con INT MySQL PHP 1
Z Problema database MySQL con XAMPP PHP 0
D problema php mysql PHP 1
D problema php mysql PHP 1
S Problema esportazione tabelle Mysql in Excel PHP 0
G Problema caricamento tabelle MySql da PhP PHP 0
Z MySQL problema Database 0
K [RISOLTO] Problema Griglia Php+Mysql PHP 13
elpirata [RISOLTO][Mysql] Problema insert valori apostrofati MySQL 1
V [MySQL] problema query con date su server MySQL 5
G inserimento csv in tabella mysql; problema con struttura PHP 11
S Problema ricevimento dati da con MySQL PHP 6
T PHP+MYSQL: problema con quelle maledette lettere accentate... PHP 5
batmanLF [MySQL] Problema funzione SUM MySQL 1
F Problema con mysql workbench MySQL 0
T Problema somma mysql MySQL 8
J [MySQL] Problema di sintassi? MySQL 1
M [MySql - VB6 sp6] Problema connessione db con alcuni pc (errore Lost connection to MySQL server...). MySQL 1
gandalf1959 problema con la codifica caratteri accentati e speciali tra php e mysql PHP 3
Q Problema su come far aggiornare i campi su un database Mysql PHP 17
webmachine [PHP][MYSQL] Problema con le SELECT PHP 5
F [MySQL] Problema con LEFT JOIN MySQL 6
G Mysql ( Query) problema interrogazione MySQL 0
simgia [MySQL] INNER JOIN problema MySQL 0
daniele430 [C++] Problema accenti - mysql - XML C/C++ 0
A [MySQL] problema con la command line client. MySQL 0
M Problema MySQL e sessioni MySQL 0
H problema input e echo più linee di una tabella mysql PHP 13
neo996sps PHP/MySQL - Problema con generazione array PHP 14
P Problema apostrofo su database MySQL... MySQL 0
M Problema connessione su OS X YOSEMITE 10.10 per il server locale mysql MySQL 0
M Problema connessione su OS X YOSEMITE 10.10 per il server locale mysql Mac e Software 0
G problema query mysql in php PHP 5
Emix Problema recupero Dati da MYSQL PHP 20
S Problema con pagination e mysql PHP 0
N Problema php e mysql PHP 2
F Problema selezione dinamica select/jsp/mysql Javascript 0
I Problema con DELETE - MYSQL PHP 6
StarFish [MySQL] Full Text problema rilevanza risultati MySQL 0
M problema con form scrittura su mysql PHP 3
B problema php e mysql PHP 3
O [risolto] Inserimento nuovo campo in mysql. Problema PHP 6
H Problema con MySQL e PHP, dopo aver fatto una SELECT non ottengo alcun risultato PHP 7
G Problema con query mysql MySQL 1
B problema query mysql php PHP 1
A problema con database (mysql - php) PHP 4
A problema con database (mysql - php) PHP 1
L PHP: problema con query mysql. PHP 3
V Problema str_replace MySql e caratteri accentati PHP 1

Discussioni simili