Re: Foreign Keys Question
| From: | tedd | Date: | Fri, 12 Dec 2008 14:36:18 +0000 |
| Subject: | Re: Foreign Keys Question | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-284538@lists.php.net to get a copy of this message | ||
At 10:24 PM +0000 12/11/08, Colin Guthrie wrote:
'Twas brillig, and tedd at 11/12/08 18:46 did gyre and gimble:Col: That's neat and a lot more powerful than I thought. It's like following a linked list to it's end while removing all traces of the thread. And I understand the "instructor delete" was not intended. Thanks, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.comAs for my "Foreign Keys Question", I think the answer is that it enforces rules upon the configuration (i.e., deleting, altering, and such), but does not provide any significant service beyond that.Well that's a fairly significant service in itself. The whole "deleting data" case is where FK's have saved me significant amount of coding. The ON DELETE CASCADE option is key here... "DELETE FROM students where student_id=1" will remove all traces of that student from the db... all the course they've attended, all the instructors who have taught them etc. keeps things nice and tidy without having to put the structure in your code all over the place. Col