Hello all . . .
I need some help on deleting some records in my database in deferent tables.
The structure is the following
..MODELS TABLE
..==============
|-PK | mod_aa
|
|
|...PRODUCT TABLE
|...===============
|...PK | prod_aa--|
|->FK | mod_aa..|
_____________|
|
|...PHOTOS TABLE
|...==============
|...PK | phot_aa
|->FK | prod_aa
|
|
|...COLORS TABLE
|...==============
|...PK | col_aa
|->FK | prod_aa
|
|
|...DIMENSIONS TABLE
|...==================
|...PK | dim_aa
|->FK | prod_aa
WHERE PK = PRIMARY KEY(ID) AND FK = FOREIN KEY(ID)
AND THE RELATION IS :
MODELS TABLE.mod_aa -> PRODUCT TABLE.mod_aa
PRODUCT TABLE.prod_aa -> COLORS TABLE.prod_aa
PRODUCT TABLE.prod_aa -> PHOTOS TABLE.prod_aa
PRODUCT TABLE.prod_aa -> DIMENSIONS TABLE.prod_aa
------------------------------------------------------------------------
How can i delete records from all table when i delete a record from the MODEL TABLE
In the PRODUCT TABLE may i have more than one records related with one MODEL TABLE record and in the COLORS TABLE, DIMENSIONS TABLE and PHOTOS TABLE may i have more that one records related with one PRODUCT TABLE record.
Thanks a lot . . . . :D
http://www.web-resources.eu
Edited 24 time(s). Last edit at 05/04/2006 05:17AM by Nikos - Vasilis Merianos.