php - Close connection PDO -


i using php-mysql-pdo-database-class / db.class.php project not able close connection in this.

here trying:

$hpsb = new selectmodel(); $hpsb->find('1'); echo $hpsb->model; $close = new db(); echo $close->closeconnection();// connection should close here echo $hpsb->id;// getting output here connection not closed 

please

the connection remains active lifetime of pdo object.

to close connection, need destroy object ensuring remaining references assign null variable holds object.

$hpsb = null  

if don't explicitly, php automatically close connection when script ends.


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -