Initial commit with updated Auth and media ignored
This commit is contained in:
24
auth/captin/getAccount.php
Normal file
24
auth/captin/getAccount.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../../connect.php';
|
||||
|
||||
$driverID = filterRequest("id");
|
||||
|
||||
// تحقق أن المعرف رقم صحيح
|
||||
if (!is_numeric($driverID)) {
|
||||
jsonError("Invalid driver ID");
|
||||
exit();
|
||||
}
|
||||
|
||||
// استخدم bindParam لتفادي حقن SQL
|
||||
$sql = "SELECT `accountBank` FROM `driver` WHERE `id` = :id";
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindParam(':id', $driverID, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
$row = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
jsonSuccess($row);
|
||||
} else {
|
||||
jsonError("No account bank record found");
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user