ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v6:reference:connection:isconnected

isConnected

Syntax
bool isConnected()
Upgrading From V5
V5 Failed connection is false
V6 failed connection is null

This function tests if a database connection has been established or not. You can use this to provide a controlled response to connection failure. The result of this function is either null, or the connectionId of the database if connected (==true)


Usage

$obj = new ADOdb\connector($acd);
 
$conn = $obj->connect($database,$user,$password);
 
if (!$conn->isConnected())
    /*
     * fail gracefully
     * /
v6/reference/connection/isconnected.txt · Last modified: by 127.0.0.1