Skip to content

isConnected

Ayoob edited this page Apr 11, 2020 · 2 revisions

isConnected

[easySQLite3 >= v0.1.0 (Beta)]

Check if a Database is connected.

Description

isConnected( void ) : boolean

This function checks if the class is connected to a database.

Parameters

None.

Return Values

The function returns a boolean value. It returns true if the class is connected to a database, otherwise it returns false.

Examples

Example #1 : Check database connection status.

include "easySQLite3.class.php";

$db = new easySQLite3("database.sqlite");

if ( $db->isConnected() ) {
    echo "Connected successfully.";
}else{
    echo "Can't connect to the Database.";
    exit;
}

Notes

Related Functions

  • easySQLite3 - Opens an SQLite3 database, or create new database.
  • connect - Connect to an existing database, or create new database.
  • disconnect - Disconnect from a database and reset the class variables to the default.

Back to Functions list

Clone this wiki locally