I am trying to assign my db returned results to an array
I have
$results = Db::get('get_items', array('id' =>$id));
$Info['items'][1]['title'] = $results[0]['Name'];
$Info['items'][1]['name'] = $results[0]['Filename'];
$Info['items'][1]['type'] = $results[0]['Type];
The DB only returns 1 row of data.
I need my $info looks like the following
Array
(
[items] => Array
(
[1] => Array
(
[title] => Title test
[filename] => test.xml
[type] => company
)
)
[mis] => data
)
I was wondering if there are a better way to assign the value to $info than just hardcoded them all. Thanks a lot!
print_r($results);? what did you get?