public function doDelete($id){ $stmt = $this->pdo->prepare('DELETE FROM articles WHERE id = :id'); $stmt->execute(array('id' => $id)); }
public function doDelete($id){ $conn = new mysqli('localhost', 'username', 'password', 'database'); $stmt = $conn->prepare('DELETE FROM articles WHERE id = ?'); $stmt->bind_param('i', $id); $stmt->execute(); $conn->close(); }The package library for this function depends on the specific library being used to connect to the database. In the above examples, one is using PDO library and another is using MySQLi library.