in reply to Re: Help with MySQL SELECT into multidimensional array
in thread Help with MySQL SELECT into multidimensional array
Thanks to everyone for their suggestions. Let me provide some more info.
The first query looks like this:
SELECT c2.id, c2.name as 'client' FROM client c2 WHERE level = 50 and status = 1;
This will produce a list of clients with a unique ID in the first column. The subsequent queries will create values for *some* of the clients, although all will have at least one value in one of the queries.
An example of a subsequent query is this:
SELECT c2,id, c2.name as 'client', count(*) as 'vm' FROM extension ext, client c1, client c2, extension_prefs exp WHERE ext.client_id = c1.id AND c1.level=100 AND exp.param="voicemail" AND exp.value=1 AND c1.parent_client_id = c2.id AND exp.extension_id = ext.id GROUP BY c2.name;
The resulting data set will indeed be a 2D structure resembling a spreadsheet. Once I have all the data compiled, I will need to generate an email (have done at least this part before in Perl) and send the data as an HTML table.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Help with MySQL SELECT into multidimensional array
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 Marshall (Canon) on Dec 02, 2011 at 16:18 UTC | |
| |
by btongeorge (Initiate) on Dec 02, 2011 at 14:32 UTC | |
by Marshall (Canon) on Dec 02, 2011 at 15:13 UTC |