MySQL foreign keys support
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
I'm wondering whether you linked them right because your description is kind of vague. Next to the auto-incrementing id column in the child tables you should also have a column that stores the id of the parent row in the parent table.

Rows never get added automatically. That's kind of the point.

If the cascade rules are set to restrict, you can't delete a user as long as they still have toys or weapons. You must remove everything belonging to that user from those tables first before you can delete the user himself. If the cascade rules are set to, well, cascade then everything belonging to that user in the child tables will automatically be wiped if the user is deleted.
I tried it, I reviewed your guide and changed it from RESTRICT to CASCADE and tried deleting a user manually from the phpMyAdmin, nothing was deleted from the toys/weapons
So, can you explain me that "ID" type next to the A/I ? I don't really get that
Reply


Messages In This Thread
MySQL foreign keys support - by NeXoR - 05.05.2016, 02:24
Re: MySQL foreign keys support - by Vince - 05.05.2016, 08:45
Re: MySQL foreign keys support - by NeXoR - 05.05.2016, 11:00
Re: MySQL foreign keys support - by NeXoR - 05.05.2016, 16:30

Forum Jump:


Users browsing this thread: 1 Guest(s)