encryptData($phone); $sql = "UPDATE `driver` SET `phone` = :encphone WHERE `id` = :id"; $stmt = $con->prepare($sql); // Bind values $stmt->bindParam(':encphone', $encphone, PDO::PARAM_STR); $stmt->bindParam(':id', $driver_id, PDO::PARAM_STR); try { $stmt->execute(); if ($stmt->rowCount() > 0) { // تم التحديث بنجاح jsonSuccess(null, "Phone updated successfully."); } else { // لم يتم العثور على أي سجل للتحديث jsonError("No records updated. Please check the driver ID."); } } catch (PDOException $e) { jsonError("Error updating record: " . $e->getMessage()); } ?>