Skip to main content
Version: Fegg 5.x (next)

Pdo::close

Disconnect from the database

Description​

public void Pdo::close()

Drops the connection this instance used from the shared connections, so the next query (of any instance) opens a new one. The connection of an open transaction is kept. PHP closes connections at the end of the request, so this is rarely needed.

Example​

Controller
$db = new \Fegg\Database\Pdo();

$rows = $db->select('cms_news')->execute()->all();
$db->close();