homerUK
11-21-2007, 09:13 AM
Hi guys,
what's the best way to get a list of results from the DB in to an array? I want to get a default list of items, then perform additional queries on them. eg
[$moduleID][$processID][$metricID] = array("item1"=>$item1, "item2"=>$item2);
is that the right way to do it? or should I use array_push?? I need a hierarchical approach so that it can be used to create a tree view later. an example data set would be
[1][1.01][R11101] ( "item1"=>"test", "item2"=>testy);
[1][0.00][R11100] ( "item1"=>"test", "item2"=>testy);
[1][1.02][R11102] ( "item1"=>"test", "item2"=>testy);
[1][1.03][R11103] ( "item1"=>"test", "item2"=>testy);
[2][2.01][R21101] ( "item1"=>"test", "item2"=>testy);
If I then need to edit a value, how do I refer to it? eg
[$moduleID][$processID][$metricID]["item1"] = "new_test";
what's the best way to get a list of results from the DB in to an array? I want to get a default list of items, then perform additional queries on them. eg
[$moduleID][$processID][$metricID] = array("item1"=>$item1, "item2"=>$item2);
is that the right way to do it? or should I use array_push?? I need a hierarchical approach so that it can be used to create a tree view later. an example data set would be
[1][1.01][R11101] ( "item1"=>"test", "item2"=>testy);
[1][0.00][R11100] ( "item1"=>"test", "item2"=>testy);
[1][1.02][R11102] ( "item1"=>"test", "item2"=>testy);
[1][1.03][R11103] ( "item1"=>"test", "item2"=>testy);
[2][2.01][R21101] ( "item1"=>"test", "item2"=>testy);
If I then need to edit a value, how do I refer to it? eg
[$moduleID][$processID][$metricID]["item1"] = "new_test";