php

DELETE using bindValue

<?php
protected function deleteUser($firstname, $lastname){
    $sql = 'DELETE FROM users WHERE firstname = :firstname && lastname = :lastname';
    $stmt = $this->connect()->prepare($sql);
    $stmt->bindvalue(':firstname', $firstname, PDO::PARAM_STR);
    $stmt->bindvalue(':lastname', $lastname, PDO::PARAM_STR);
    $stmt->execute();
}

DELETE

bindValues

Was this helpful?