Skip to content
Advertisement

DELETE rows with prepared query in PHP and MySQL [closed]

This is a part of a webservice call to delete a record in MySQL database But I am getting an error saying “Database Error. Couldn’t delete post!” where is the error in my code.

JavaScript

UPDATE:

$stmt->execute(array()) should be replaced to $stmt->execute($query_params) the params are missing

Advertisement

Answer

You have prepared the parameters for you statement, but you never actually use them with the statement.

Try changing:

JavaScript

to:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement