function mysql_query_array($query, $error="error: mysql_query_array"){
$r = mysql_query($query) or die($error);
$row = mysql_fetch_assoc($r);
$row_key = array_keys($row);
$j=0;
do{
for($i=0; $i<count($row_key); $i++){
$row_array[$row_key[$i]][$j] = $row[$row_key[$i]];
}
$j++;
} while($row = mysql_fetch_assoc($r));
unset($row);
return $row_array;
}
array(
id => array(0 => 1,0 => 2,0 => 3),
name => array(0 => name1,0 => name2,0 => name3),
var => array(0 => 10, 0 => 20, 0 => 30),
)