array from mysql help?

From: Date: Tue, 24 Jul 2001 14:32:44 +0000
Subject: array from mysql help?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-59350@lists.php.net to get a copy of this message
Hi, I want to create an array like this: $tree = array ( "first" => array ("stuff1", "stuff2", "stuff3"), "second" => array ("stuff1", "stuff2") ); based on tree of information, stored in a database table: level parent_cat child_cat -------------------------- 1 first first 1 second second 2 first stuff1 2 first stuff2 2 first stuff3 2 second stuff1 2 second stuff2 That translates to a structure like this: first second | | |---------|--------| |-----------| stuff1 stuff2 stuff3 stuff1 stuff2 Can someone point me towards an SQL example that would help me structure the query, and an example of how to reference information in it once I have it? e.g. a while list/each but for a multidimensional array? cheers, jaxon.

« previous php.general (#59350) next »