[PHP-DB] Tables and foreign keys

2011-12-25 Thread Karl DeSaulniers
Hello all, I have two database tables. Cart and a cartdetails. I want the information for the cartdetails to be based on/autofilled info from cart. I want the ability to delete from cart and cartdetails to automatically clear as well. Would a foreign key be best suited for this? What kind of

Re: [PHP-DB] Tables and foreign keys

2011-12-25 Thread Amit Tandon
Dear Karl Foreign key is a good option (provided you use InnoDB database) to automate the deletion/updation of cart details when you remove cart. Besides 1:1 cardinality is good or bad can only be decided on the semantics of your tables. As a an aside, if it is 1:1 cardinality, then you can