I did try that one, but not understanding how to get the field names.
Code:
$result = db_query($mysqli, $query); $columns = $result->field_count;
for($i = 1; $i < $columns; $i++) {
echo($result->fetch_field_direct());
// echo($result->fetch_field_direct()->name);
?><?
} ?><br><?
while($row = $result->fetch_assoc()) {
foreach ($row as $r) { ?><? echo $r; ?><?
} ?><br><?
}