This commit is contained in:
Hamza-Ayed
2026-04-30 17:34:02 +03:00
parent b602106b79
commit 24d38160c0
2 changed files with 18 additions and 9 deletions

View File

@@ -7,18 +7,14 @@ $phone = filterRequest("phone");
// Encrypt phone
$encphone = $encryptionHelper->encryptData($phone);
$sql = "SELECT
*
FROM
`driver`
WHERE
phone = :encPhone";
error_log("[GIFT_CHECK] Received Phone: " . $phone);
error_log("[GIFT_CHECK] Encrypted Phone: " . $encphone);
$sql = "SELECT * FROM `driver` WHERE phone = :encPhone OR phone = :rawPhone";
$stmt = $con->prepare($sql);
// FIX 1: Bind AFTER preparing the statement
// FIX 2: Use the same placeholder name (:encPhone)
$stmt->bindParam(':encPhone', $encphone, PDO::PARAM_STR);
$stmt->bindParam(':rawPhone', $phone, PDO::PARAM_STR);
$stmt->execute();