I have an existing array, and I want to add some items in it from a mysql row
$extendedadmindetails = full_query("SELECT * FROM `tbladmins` WHERE `id`='{$_SESSION['adminid']}'");
$extendedadmindetailsrow = mysql_fetch_assoc ($extendedadmindetails);
array_push($apiresults, $extendedadmindetailsrow);
This returns an array in an array:
Array
(
[result] => success
[adminid] => 1
[name] => My Name
[notes] =>
[signature] =>
[allowedpermissions] => My Name
[departments] => 1
[requesttime] => 2017-02-26 12:44:06
[0] => Array
(
[id] => 1
[uuid] => sqdqsdqsdqsdq454
[roleid] => 1
[username] => Myname
[password] => $dfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdf
[passwordhash] => $jghjghjghjghjghjghjghjghjg
[updated_at] => 0000-00-00 00:00:00
)
)
while I need:
Array
(
[result] => success
[adminid] => 1
[name] => My Name
[notes] =>
[signature] =>
[allowedpermissions] => My Name
[departments] => 1
[requesttime] => 2017-02-26 12:44:06
[id] => 1
[uuid] => sqdqsdqsdqsdq454
[roleid] => 1
[username] => Myname
[password] => $dfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdf
[passwordhash] => $jghjghjghjghjghjghjghjghjg
[updated_at] => 0000-00-00 00:00:00
)
I believe I should use array_push to add to an existing array, but I'm not sure how to proceed from there. Do I need to loop trough the extendedadmindetailsrow array and add items 1 by 1? Any one can help me out with this?
Thanks!!