Re: Re: Listing parent ids

From: Date: Thu, 28 Jul 2011 15:21:35 +0000
Subject: Re: Re: Listing parent ids
References: 1 2 3 4 5  Groups: php.db 
Request: Send a blank email to php-db+get-47944@lists.php.net to get a copy of this message
""Arno Kuhl"" <arno@dotcontent.net> wrote in message news:DB930522404B4552B8A15AF991C57E30@point01... > > Hi Jim. Only one linked list of parentids. No siblings. > Multiple records can have the same parentid, but that doesn't play a role. > Okay. So you want only one 'family tree' at any given time, and a tree is a straight line, ie, it has no branches. Sounds to me like a loop surrounding a query that seeks out a specific id which is continually re-evaluated from the last-read record's parentid. As each query result is obtained (one record), the pair of keys is saved in an array. Curiousity has me asking - what are the contents of these records that such a structure works? To me, this 'parentid' sounds like a foreign key, which is usually used to read a separate table in a normalized db. Your response that "multiple records can have the same parentid" is the same as a "1-M" relationship, which implies the need for normalization. Apparently your situation has normalized everything(?) into one table.

« previous php.db (#47944) next »