try {
$query = "UPDATE tours SET tour_active = ? WHERE tour_sys_id = ?";
$tour_active_value = '1';
$tour_sys_id_value = 'egypt_tour';
$con = new PDO("mysql:host=localhost;dbname=" . "mydbname" . ";", "mydbusername", "mydbpassword");
$con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $con->prepare($query);
$stmt->bindParam(1, $tour_active_value, PDO::PARAM_INT); // for integer
$stmt->bindParam(2, $tour_sys_id_value, PDO::PARAM_STR); // for string
$status = $stmt->execute();
echo $status;
} catch(PDOException $e){
var_dump($e);
}
If this answer was helpful to you, an upvote would be appreciated. Thank you.