php-db | 2000121
Date: 12/11/00
- Next message: fabrizio.ermini <email protected>: "Re: [PHP-DB] Question about using php with Microsoft SQL server"
- Previous message: Leonard Tambunan: "Re: [PHP-DB] Question about using php with Microsoft SQL server"
- In reply to: Anthony Martin: "[PHP-DB] <PK><FK>"
- Next in thread: Doug Semig: "Re: [PHP-DB] <PK><FK>"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Od: "Anthony Martin" <Anthony <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: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: fabrizio.ermini <email protected>: "Re: [PHP-DB] Question about using php with Microsoft SQL server"
- Previous message: Leonard Tambunan: "Re: [PHP-DB] Question about using php with Microsoft SQL server"
- In reply to: Anthony Martin: "[PHP-DB] <PK><FK>"
- Next in thread: Doug Semig: "Re: [PHP-DB] <PK><FK>"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

