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

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -