Creating Drivers Table..."; include 'config/config.php'; $query = "CREATE TABLE `tbl_driver` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `mobile_no` varchar(15) NOT NULL, `aadhar_card` varchar(500) DEFAULT NULL COMMENT 'Path to Aadhar card file', `licence` varchar(500) DEFAULT NULL COMMENT 'Path to driving licence file', `profile_photo` varchar(500) DEFAULT NULL COMMENT 'Path to profile photo file', `driver_experience` varchar(100) DEFAULT NULL COMMENT 'Years of driving experience', `vehicle_type` json DEFAULT NULL COMMENT 'Vehicle types as JSON array: [\"Automatic\", \"Manual\", \"Load Vehicle\"]', `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0=active, 1=inactive', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `created_by` int(11) DEFAULT NULL, `updated_by` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `mobile_no` (`mobile_no`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;"; echo "
Executing CREATE TABLE query...
"; echo "" . htmlspecialchars($query) . "";
try {
$stmt = $pdo->prepare($query);
$stmt->execute();
echo "Executing index query " . ($index + 1) . "...
"; echo "" . htmlspecialchars($indexQuery) . "";
try {
$stmt = $pdo->prepare($indexQuery);
$stmt->execute();
echo "| Field | Type | Null | Key | Default | Extra |
|---|---|---|---|---|---|
| " . $column['Field'] . " | "; echo "" . $column['Type'] . " | "; echo "" . $column['Null'] . " | "; echo "" . $column['Key'] . " | "; echo "" . ($column['Default'] ?? 'NULL') . " | "; echo "" . $column['Extra'] . " | "; echo "
The tbl_driver table has been created with the following columns:
"; echo "You can now create driver management pages similar to the customer management system.
"; echo "