Code: Select all
ALTER TABLE `a` ADD FOREIGN KEY (`category_id`) REFERENCES `categories` (`category_id`) ON DELETE RESTRICTWhat I'm trying to accomplish is a restriction on a table. I'd like for the `categories` table's rows to not be deleted if there are rows in the `a` table referencing the row in `categories` being deleted.
I don't get exactly what I'm doing wrong. :S
Please help me on this one.
Thanks for reading.