Getting all database entries into organized array

Posted by Industrial on Stack Overflow See other posts from Stack Overflow or by Industrial
Published on 2010-05-08T15:36:28Z Indexed on 2010/05/08 15:38 UTC
Read the original article Hit count: 200

Filed under:
|
|

Hi everyone,

I have just made the update/add/delete part for the "Closure table" way of organizing query hierarchical data that are shown on page 70 in this slideshare: http://www.slideshare.net/billkarwin/sql-antipatterns-strike-back

However, I have a bit of an issue getting the full tree back as an multidimensional array from a single query.

Here's what I would like to get back:

 array (

 'topvalue' = array (
                     'Subvalue',
                     'Subvalue2',
                     'Subvalue3' = array ('Subvalue 1',
                                          'Subvalue 2',
                                          'Subvalue 3'
                                         )
                     );

 );

© Stack Overflow or respective owner

Related posts about mysql

Related posts about php