//connect to database $db = new PDO("mysql:host=localhost;dbname=myDB", "username", "password"); //prepare delete query $stmt = $db->prepare("DELETE FROM products WHERE id=:id"); //bind parameter and execute $stmt->bindParam(":id", $idToDelete); $stmt->execute();
//connect to database $conn = mysqli_connect("localhost", "username", "password", "myDB"); //prepare delete query $stmt = $conn->prepare("DELETE FROM users WHERE email=?"); //bind parameter and execute $stmt->bind_param("s", $emailToDelete); $stmt->execute();This code connects to a MySQL database using the MySQLi library and prepares a delete query to remove a user from a table called "users". The query uses a placeholder symbol "?", which is later bound to a variable containing the email of the user to delete.