On Fri, Nov 28, 2008 at 5:52 PM, Fergus Gibson <fgibson75@xxxxxxxxx> wrote: > On Thu, Nov 27, 2008 at 11:19 AM, Bastien Koert <phpster@xxxxxxxxx> wrote: > > 2. It is possible to use the application to handle the keys instead of > the > > database, it involves more work around key checking / validation before > > creating or updating records, but it can be done if the INNODB table type > is > > not accessible to you for some reason. > > Yes, but generally foreign key constraints are preferable. The > database server is compiled in native code, so it'll be much faster at > handling this issue; and it may avoid the necessity of your script > submitting multiple queries to resolve the foreign key issues. A > bigger issue though is that the implementation of foreign key > constraints on the server will have been exhaustively tested. > Reinventing the wheel in your own PHP code may introduce bugs that > cause loss or damage to your data. > Correct, I was merely offering an alternative if the INNODB / FK constraints are not available. I have to do that with ASP code that I maintain, but its a real bitch to manage -- Bastien Cat, the other other white meat