Mysql onDelete cascade after table has been created
4 views
Skip to first unread message
apoorv....@gmail.com
unread,
Feb 20, 2016, 2:43:41 AM2/20/16
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hello I know we can use cascading while creating table but After I created table and there are bunch of data in it how would I do ondelete cascade.
I have a user table and a article table with one to many relationship and I have a foreign key user_id in article which refrences id in user table when I ran this query
ALTER TABLE `article`
FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE;
Now i Have foreign key but when I delete an entry in user table the corresponding entry in article does not get deleted.
Jerry Stuckle
unread,
Feb 20, 2016, 10:17:26 AM2/20/16
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
What does this have to do with PHP?
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstu...@attglobal.net ==================