ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:isconnected

This is an old revision of the document!


isConnected

Syntax
bool isConnected()

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 false, or the connectionId of the database if connected (==true)

Usage

$conn = @connect($database,$user,$password);
 
if (!$conn->isConnected())
    /*
     * fail gracefully
     * /
v5/reference/connection/isconnected.1452648666.txt.gz · Last modified: 2017/04/21 11:34 (external edit)