ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:userguide:learn_abstraction:establishing_connection

This is an old revision of the document!


Establishing A Connection

connection needs to be first established to the database. The parameters required to connect to the database are the same as when using a direct PHP connection. For detailed information about connections see connect()

include 'adodb_dir/adodb.inc.php';
 
$db = newAdoConnection('odbc');
$db->connect($parameters);

The returned $db object is used for all ADOdb activity. If the connection fails, the connect statement returns false and an error is logged.

In order to test if a connection has been established, the command

$db->isConnected()

can be executed.

v5/userguide/learn_abstraction/establishing_connection.1458000858.txt.gz · Last modified: 2017/04/21 11:40 (external edit)