i have two table one for reservations and other one for users.With the code below i want to find all the users whose reservations are out to date. Then from that i want to return a multidimensional array containing their informations.
The problem I’m having is that when i read the array i only have informations for one user only. How can i do to add values to a multidimensional array with keys?
function reservationsOutDate()
{
$requete = mysql_query("SELECT*FROM reservations WHERE dateRetour <CURDATE();");
$list = array();
while($row = mysql_fetch_array($requete))
{
$userInfos = getInfos("users","userName",$row['userName']);
//the function return an array containing the name, family name and email of the user
$list = array(
$row['userName'] => array(
"name" => $userInfos['name'],
"familyName" => $userInfos['familyName'],
"email" => $userInfos['email']));
}
return $list;
}