Search code snippets, questions, articles...

Delete from DB OOP

//delete from DB
<?php
    public function deleteUser($firstname, $lastname){
        $sql = 'DELETE FROM users WHERE firstname = ? && lastname = ?';
        $stmt = $this->connect()->prepare($sql);
        $stmt->execute([$firstname, $lastname]);
    }

//in index.php
$deleteUser = new test();
$deleteUser->deleteUser('John','Doe');
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place.

DELETE

OOP

DB

Search Index Data (The code snippet can also be found with below search text)

DELETE
OOP
DB
Was this helpful?
0 Comments