Getting data to save with foreign key |
A parent-child relation in the same table must be NULL-able.
So, set your parent column to allow NULL. Or if you wish to keep it at NOT NULL, you have to create a menu item with ID 0, that will never be shown in the web, and set your parent column to default value 0. Although the first method would be prefered I suppose. Edit: why nullable? because the top level item can not have a parent.
Website: http://tomaz.lovrec.eu
GitHub: https://github.com/slax0rr Twitter: https://twitter.com/slax0rr |
Messages In This Thread |
Getting data to save with foreign key - by cerberus478 - 11-25-2014, 11:45 PM
RE: Getting data to save with foreign key - by slax0r - 11-26-2014, 03:44 AM
RE: Getting data to save with foreign key - by cerberus478 - 11-26-2014, 03:52 AM
|