If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Without a primary key that indicates that duplicates are allowed which means you can never accurately target a unique record.
Properly normalized, there should always be a primary key. A surrogate id is a convenience that's often treated as the determining unique factor. This can drag a designer into a false sense of normalization.
In the above you have, if the parent_id is unique, that would then become your primary key. If it is not unique, I'd suggest that the parent_id and title are unique making it a unique composite.

Also, this has nothing to do with PHP. Moving to other databases forum.

PHP Code:

header('HTTP/1.1 420 Enhance Your Calm');

Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

I have the db setup to where I get a main listing.
each of the items has a unique id.
I figured I since I would be identifying the the settings based on the unique id of in the main listing I could remove the extra columns. save coding.

The question is: Can there be multiple occurrences of the same parentid??

Yup that is the leading question! I just found that out the hard way! With multiple occurances of the parentid you *Need* a unique identifier to make editing easier. In other tables though the parentid becomes the unique identifier when only one entry is allowed per parent.

Where a table has a many to one relationship to another table the primary key will typically consist of two fields - the first being the key of the record in the other table and the second allowing the records associated with the other table to be uniquely identified. That's assuming that you have a primary key and that duplicates are not allowed. If duplicates are allowed in the many table then both tables can use the same key.