Update: 2026-06-11 18:22:57
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
// Include the database connection file
|
||||
include "../../connect.php";
|
||||
|
||||
// Filter and validate the phone number input
|
||||
$phone_number = filterRequest("phone_number");
|
||||
|
||||
// Prepare the SQL query using a parameterized query to prevent SQL injection
|
||||
$sql = "UPDATE phone_verification_passenger SET verified = 1 WHERE phone_number = :phone_number";
|
||||
|
||||
// Prepare the statement
|
||||
$stmt = $con->prepare($sql);
|
||||
|
||||
// Bind the phone number parameter
|
||||
$stmt->bindParam(":phone_number", $phone_number);
|
||||
|
||||
// Execute the query
|
||||
$stmt->execute();
|
||||
|
||||
// Get the number of affected rows
|
||||
$affectedRows = $stmt->rowCount();
|
||||
|
||||
// Check if the update was successful
|
||||
if ($affectedRows > 0) {
|
||||
// Return a success response
|
||||
printSuccess($data = ["message" => "Phone number verified successfully"]);
|
||||
} else {
|
||||
// Return a failure response
|
||||
printFailure($message = "No phone number found or verification failed");
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user