ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:isconnected

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.txt · Last modified: 2016/01/17 00:12 by mnewnham