Update: 2026-06-29 23:09:43
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
include "../../connect.php";
|
||||
|
||||
|
||||
// Use prepared statement to prevent SQL injection
|
||||
$sql = "
|
||||
SELECT * FROM `server_locations`
|
||||
";
|
||||
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
|
||||
$stmt->execute();
|
||||
|
||||
$car_locations = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($car_locations) {
|
||||
printSuccess($car_locations);
|
||||
} else {
|
||||
printFailure("No car locations found");
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
printFailure("Database error: " . $e->getMessage());
|
||||
}
|
||||
Reference in New Issue
Block a user