Links: dibi | API reference

Forum: [česky] [english]

dibi forum

tiny ‘n’ smart
database layer

You are not logged in.

#1 3 years ago

gotisch
Member
Registered: 2009-05-23
Posts: 3

Close connection

Do i need to call

dibi::disconnect();

at the end of every page or is that done automatically? currently im using

config.php

require_once("libs/dibi.min.php");
$config_Bugtracker = array (
        'driver'    => 'mysql',
        'host'      => 'localhost',
/*...*/
        'charset'   => 'utf8',
        'lazy'      => true     //we set lazy so that connection is only made if we use it.
        );
dibi::connect( $config_Bugtracker , 'BugTracker' );

and in file where query is done:

include("config.php");
        $connection = dibi::getConnection("BugTracker");
        $result = $connection->query("  SELECT  blablabla",$username);
        unset($result);

is that enough or do i need to add the dibi::disconnect in file where query is done?

 

#2 3 years ago

David Grudl
Administrator
Registered: 2005-02-08
Posts: 5833

Re: Close connection

Connections (and resultset) are closed and released from memory automatically, you do not need to call disconnect().

 

Board footer