MySQL Forums
Forum List  »  PHP

MySQL DELETE QUERY HELP PLZ ! ! !
Posted by: Nikos - Vasilis Merianos
Date: May 04, 2006 01:21AM

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.

Options: ReplyQuote


Subject
Written By
Posted
MySQL DELETE QUERY HELP PLZ ! ! !
May 04, 2006 01:21AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.