you have two possible situations:
Case (A) you can delete 'astro_tbl' rows with NO particular actions
Case (B1) you must alter 'astro_tbl' table adding a cascade costraint to have the system
delete rows in the 'astro_tbl' table when one row in 'authen_tbl' table is being deleted
if the 'mail' field is referred by the 'astro_tbl.mail' field
Case (B2) you must alter 'astro_tbl' table adding a cascade costraint to have the system
delete rows in the 'astro_tbl' table when one row in 'profile_tbl' table is being deleted
if the 'pid' field is referred by the 'astro_tbl.pid' field
manual(http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html) or my
previous reply to see syntax for altering FOREIGN KEY costraints.
Da: Chandra N [mailto:chandragsk@stripped]
Inviato: martedì 17 giugno 2008 12.06
Oggetto: delete a data from 3 tables
I created 3 tables namely authen_tbl,profile_tbl,astro_tbl,in which column
name mail as primary key in authen_tbl table ,
pid int primary key auto_increment,
foreign key (mail) references authen_tbl(mail)
given in astro_tbl table
foreign key(pid) references profile_tbl(pid)
given in astro_tbl.
My problem is how to delete a data at a strech from 3 tables.