ok
Direktori : /home2/globaltriumphfou/public_html/ |
Current File : /home2/globaltriumphfou/public_html/eventapi.php |
<?php include "admin_panel/dbconn.php"; // Check connection if ($connection->connect_error) { die("Connection failed: " . $connection->connect_error); } $query = "SELECT * FROM event_list order by gal_date desc"; // Replace with your SQL query $result = $connection->query($query); if ($result->num_rows > 0) { $rows = array(); while($row = $result->fetch_assoc()) { $rows[] = $row; } echo json_encode($rows, JSON_PRETTY_PRINT); } else { echo "0 results"; } $connection->close() ?>