mysql - How to make foreign key update based on parent -


i have 2 tables, , i've made relation using designer between id column of first table user_id column of second table. , how add code or when, example, parent (id) deleted, user_id values correspond deleted id deleted? tried deleting 1 of registered ids, corresponding rows in child table didn't deleted.

i've done searching, i'm still confused.

thank you.

note: i'm experimenting mysql , php, , little blog i'm making.

please add on delete referential action foreign key constraint.

more details found here: https://dev.mysql.com/doc/refman/5.6/en/create-table-foreign-keys.html

for case, on delete cascade should fine.


Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -