php-general | 2001072
Date: 07/24/01
- Next message: Jeremy Maziarz: "[PHP] Re: .htaccess"
- Previous message: jon <email protected>: "[PHP] .htaccess"
- In reply to: Bernie Kruger: "Re: [PHP] PDF dll"
- Next in thread: Remo Pini: "RE: [PHP] array from mysql help?"
- Reply: Remo Pini: "RE: [PHP] array from mysql help?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Jeremy Maziarz: "[PHP] Re: .htaccess"
- Previous message: jon <email protected>: "[PHP] .htaccess"
- In reply to: Bernie Kruger: "Re: [PHP] PDF dll"
- Next in thread: Remo Pini: "RE: [PHP] array from mysql help?"
- Reply: Remo Pini: "RE: [PHP] array from mysql help?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

