Welcome Guest, Not a member yet? Register   Sign In
I need help with relationships between parent category and child category on a innodb engine.
#8

[eluser]weboide[/eluser]
I have a project here where I have this foreign key (I changed the names to be more relevant):

Table "Car":
Code:
`carinfo_id` int(11) DEFAULT NULL
...
KEY `fk_car_carinfo1` (`carinfo_id`),
CONSTRAINT `fk_car_carinfo1` FOREIGN KEY (`carinfo_id`) REFERENCES `carinfo` (`id`) ON DELETE SET NULL ON UPDATE CASCADE

And carinfo_id can be set to NULL where there is no carinfo related to that car. And also you can see that ON DELETE, it is also set to NULL.

Is that what you are trying to achieve?


Messages In This Thread
I need help with relationships between parent category and child category on a innodb engine. - by El Forum - 03-31-2010, 06:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB