As I understood from the non-working code, this is done wrong, right?

$del = $pdo->prepare("DELETE FROM `table` WHERE `id` = 6"); $del->execute() 

Mistake

 SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. 

Help me figure out how to actually do this.

  • $ pdo-> errorInfo (), $ del-> errorInfo ()? - Bookin Nov.
  • @Bookin added an error to the question - Vladimir Alexandrov
  • Show more code ... Because it’s not so clear how you work with PDO and what it wants from you. - fens Nov.
  • You need to release the prepared statement from the previous request. $stmt->closeCursor(); - rjhdby
  • @rjhdby This function does not release, but closes the cursor. By this, the operation rather resembles the treatment of a headache with a guillotine. - Ipatiev

0