hey all
I have these lines

create table Singers(SingerName varchar(30),picture text,id int primary key auto_increment);

create table Songs(id int primary key auto_increment,sid int,foreign key(sid) references Singers(id) ON DELETE CASCADE);

In situation I want to delete a Singer for example who has the id->1 from Singer's table
automaticaly to delete all his Songs from Song's table where sid has same value with id->1

but it does not work with me,,

I leave with this picture.


obviously is your storage engine not innodb, for example it could be myisam. If so, then foreign-key definitions are useless. Indeed, mysql allow you to define foreign keys, however they won't be processed, kinda everlasting bug or so!

Except your are using storage engine innodb which know them.

It is always a good idea only to using innodb, here the policy "ON DELETE CASCADE" works fine and much more other things other storage engines lack of.

-- tesu

so you are saying that if I wanna use ON DELETE CASCADE I have to convert type of MySQL to InnoDB instead of myisam?