aha...no to DELETE CASCADE je pre mna nieco nove. Cital som teraz par veci o tom, znie to zaujimavo.
Aj som si to skusil, ale niekde je zrada:
prva tabulka nech sa vola SHOP so stlpcami ID, MENO, HESLO.
druha - ta moja - tabulka nech sa vola USERS a vytvoril som ju takto
Kód:
CREATE TABLE users (
id int NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id),
VEK text NOT NULL,
ZAMESTNANIE text NOT NULL,
PLAT text NOT NULL,
assignment_id int NOT NULL,
INDEX fk_assignment_id (assignment_id),
FOREIGN KEY (assignment_id) REFERENCES shop(id) ON DELETE CASCADE
)
ale ked pomocou DELETE vymazem riadok z tabulky shop, z druhej tabulky sa mi nevymaze nic...