I'm having some problems getting my mind around creating a multidimensional array from a database. Maybe I'm not even really tackling the problem in the best way so any advice that can be given is greatly appreciated.
What I'm attempting to do is create a table on a page of server information populated from my database. The server data contains, among other things, the state the server is located in. I want to pull that data, have the table show the states, then using a jQuery app, show all the servers and their information that are associated with that state. I figured a multidimensional array would be the answer but I just can't seem to create my array.
I'm guessing I'll have to use a few while loops to determine what state is being pulled then the server and finally the server information. I figure the array would look something like this:
servers(
state1(
server1(info1,info2,info3)
server2(info1,info2,info3)
)
state2(
server1(info1,info2,info3)
server2(info1,info2,info3)
)
)
Any thoughts or suggestions on how I can do this or an easier way I might accomplish it?