prepare("INSERT INTO bunks (name, owner, contact, location) VALUES (?, ?, ?, ?)");
$stmt->execute([$name, $owner, $contact, $location]);
$message = '
Bunk added successfully!
';
} catch (PDOException $e) {
$message = 'Error: ' . $e->getMessage() . '
';
}
} else {
$message = 'Please fill in all fields.
';
}
}
// Fetch all bunks to display
$stmt = $pdo->query("SELECT * FROM bunks ORDER BY name");
$bunks = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
Manage Bunks
List of all petrol bunks registered in the system.
| Name |
Owner |
Contact |
Location |
| No bunks found. Add one to get started. |
|
|
|
|