Add remaining project files (exclude ignored folders)

This commit is contained in:
WD - Dev
2025-07-05 15:11:40 +07:00
parent a96eb2b958
commit b440b80882
4697 changed files with 1365702 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
// Include your database connection
include '../config/connect.php';
if (isset($_GET['id'])) {
$id = intval($_GET['id']); // Sanitize the input to prevent SQL injection
// Prepare the SQL statement to fetch the server data
$stmt = $pdo->prepare("SELECT * FROM gudang WHERE id = :id");
$stmt->bindParam(':id', $id, PDO::PARAM_INT);
$stmt->execute();
// Fetch the data
$data = $stmt->fetch(PDO::FETCH_ASSOC);
if ($data) {
// Return the data as JSON
echo json_encode($data);
} else {
// If no data found, return an error message
echo json_encode(['error' => 'Data not found']);
}
} else {
// If no ID is provided, return an error message
echo json_encode(['error' => 'Invalid ID']);
}
?>