Fatal error: Call to undefined method PDO::close()
问题 I have got that error and the line was this: public function __destruct() { $this->db->close(); } I use PDO, is this the problem, does the PDO driver not recognize this function? If yes, what is its equivalent in PDO? 回答1: A PDO connection is closed by destroying its object: The connection remains active for the lifetime of that PDO object. To close the connection, you need to destroy the object by ensuring that all remaining references to it are deleted--you do this by assigning NULL to the