79669772

Date: 2025-06-17 21:28:52
Score: 1
Natty:
Report link
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.

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Blacklisted phrase (1): appreciated
  • Blacklisted phrase (0.5): upvote
  • Long answer (-0.5):
  • Has code block (-0.5):
Posted by: Dankyi Anno Kwaku