Mysql
 sql >> Base de données >  >> RDS >> Mysql

PHP :Trier le résultat MySQL dans un tableau multidimensionnel

$values = array(); //base array
while ($line = mysql_fetch_assoc($front_end_query_result)){ //fetch the rows
    //in the base array create a new array under 'name'
    $values[$line['name']] = array(); 
    //for each item in the result set, add it to the new array
    foreach ($line as $key => $value) {
        $values[$line['name']][$key] = $value;
    }
}