This topic is locked
[SOLVED]

 master / detail on the same level in the list

3/30/2007 9:00:19 PM
PHPRunner General questions
V
vytb author

Hello again,
I have a list of individuals that have other individuals associated in 'details' pages. For example:

  1. John ( a. Ann, b. Ron)
  2. Paul ( a. Mary, b. Andrew)

    3....
    What's the best way to regroup them to the list on same level?
    1.0. John

    1.a. Ann

    1.b. Ron

    2.0. Paul

    2.a. Mary

    2.b. Andrew

    3....

W
webwork 4/2/2007

Consider using the secondary detail record's id field, which would be unique, as part of an array installed in a field of the primary individuals.

This array would simply be a list of values separated by a "comma" in one text field. In the case of your first example the field would look like this:

a,b

If there were 5 individuals as part of the second record group this list might look like this:

a,b,h,k,d,l

Then you need an SQL script to pull the detail records out of the array. To find this search on google:

'parse comma array php' or whatever other database type you have

V
vytb author 4/2/2007

Thanks I'll try...

Consider using the secondary detail record's id field, which would be unique, as part of an array installed in a field of the primary individuals.

This array would simply be a list of values separated by a "comma" in one text field. In the case of your first example the field would look like this:

a,b

If there were 5 individuals as part of the second record group this list might look like this:

a,b,h,k,d,l

Then you need an SQL script to pull the detail records out of the array. To find this search on google:

'parse comma array php' or whatever other database type you have