connect_error) { die("Connection failed: " . $mysqli->connect_error); } $result = $mysqli->query("SHOW COLUMNS FROM daily_reports"); if ($result) { while ($row = $result->fetch_assoc()) { echo $row['Field'] . "\n"; } } else { echo "Error: " . $mysqli->error; } $mysqli->close();