<?php
function transfer_result_to_array($queryresult){
//put values in array
while ($a=mysql_fetch_assoc($queryresult)){
$values[]=array_values($a);
}
//put keys into array
mysql_data_seek($queryresult,0);
$a=mysql_fetch_assoc($queryresult);
$keys=array_keys($a);
//build combined array
$i=0;
foreach ($values as $nothing=>$multi){
foreach ($multi as $valuenr=>$value){
foreach ($keys as $keynr=>$label) {
if ($keynr==$valuenr)
$resultvalue[$label]=$value;
$result[$i]=$resultvalue;
}
}
$i++;
}
return $result;
}
q="SELECT * FROM table";
if (!$rAll=mysql_query($q)){
echo 'fout';
die;
}else{
$rArray=transfer_result_to_array($rAll);
}
?>