<?php
header('Content-Type: application/json; charset=utf-8');
error_reporting(E_ALL);
ini_set('display_errors', 1);

$conn = new mysqli('localhost', 'transubd', 'Tr@nsub2@24', 'transubd_gestionparc');
if ($conn->connect_error) {
    die(json_encode(['error' => $conn->connect_error]));
}

$result = $conn->query("SHOW COLUMNS FROM bus");
$columns = [];
while ($row = $result->fetch_assoc()) {
    $columns[] = $row['Field'];
}

echo json_encode(['columns' => $columns], JSON_PRETTY_PRINT);
$conn->close();