in reply to Help with MySQL SELECT into multidimensional array
From the description, you appear to be talking about a spreadsheet type of representation with clientNames in column A and more columns B...XX with more info. For some clients, there is no relevant info in some columns.
Rather than a 2D matrix, I would consider a Hash of Hash,HoH. The data stucture would look like:
The clients are the hash key and sub-hashes correlated the column Name with a value. This way as the structure each row of a 2D matrix expands to more columns (it sounds like that can dynamically happen), you don't have to expand each row with zero/null placeholders, just fill in relevant data. Anyway try one SQL query and tell us how that goes.( client23 => { columnAname => 123, columnXYname => 'Bob'}, client42 => { columnXYname => 'Jim', columnBname => 765}, );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help with MySQL SELECT into multidimensional array
by btongeorge (Initiate) on Dec 02, 2011 at 09:30 UTC | |
by Marshall (Canon) on Dec 02, 2011 at 14:14 UTC | |
by btongeorge (Initiate) on Dec 02, 2011 at 15:27 UTC | |
by Marshall (Canon) on Dec 02, 2011 at 15:50 UTC | |
by btongeorge (Initiate) on Dec 02, 2011 at 15:57 UTC | |
| |
by btongeorge (Initiate) on Dec 02, 2011 at 14:32 UTC | |
by Marshall (Canon) on Dec 02, 2011 at 15:13 UTC |