Od: "Anthony Martin" <[EMAIL PROTECTED]> Temat: [PHP-DB] <PK><FK> > I'm having trouble figuring out this referential logic. I'm writing a > rudimentary directory structure for dividing HTML sections from one another. > Right now, my tables have no referential integrity, except for ones > pertaining outside the directory structure (those being profiles and > groups). My problem is that I cannot find a way to declare primary keys and > hence foreign keys yet maintain the functionality I'm looking for. > [snipped some code] > > The answer is staring me in the face: use artificial primary keys. But I've > gotten away with avoiding them for the whole project. As you can see, I > avoid artificial primary keys by using the depth and name combination. But > in order to have multiple directory entries in the same depth, I have to > allow non-unique entries. To allow non-unique entries, I can't have primary > keys. If I can't have primary keys, I can't have foreign keys pointing to > them. This depends one-from-another: if you can not declare PK, you will not have FK - sad but true, it's a limitation of SQL-92. Try to force RI using triggers but it will be slower - and more painful. Cheers Jarek Zgoda -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]