I have this function :
function userKids(mysqli $Con, $Parent) {
$stmt = $Con->prepare('SELECT KidsName, KidsAge, KidsGender FROM Kids WHERE Parent = ?');
$stmt->bind_param('s', $Username);
$stmt->execute();
$Kid = null;
$Kids = array();
$stmt->bind_result($Kid, $KidsAge, $KidsGender);
while($stmt->fetch()) {
$Kids[] = $Kid;
}
return $Kids;
}
currently my WHILE loop produce array like this :
Array ( [0] => john [1] => jane )
Now, how to produce multidimensional array so I can get the Age and Gender as well, like this :
Array
(
[john] => Array
(
[0] => 3
[1] => male
)
[jane] => Array
(
[0] => 2
[1] => female
)
)