Icon edb_connect

Connects to an ElevateDB configuration/server and database using a connection string.

Syntax
edb_connect(<ConnectionString>)

<ConnectionString> =

Semi-colon-separated set of connection string keywords

Returns
Connection handle if successful, or FALSE if any errors

Usage
The edb_connect function uses a connection string to establish a connection to a local ElevateDB configuration or ElevateDB Server, as well as a specific database. Please see the Connection Strings topic for a list of all of the connection string keywords that can be specified. If the connection fails and the edb_connect function returns False, you can use the edb_errcode and edb_errmsg functions to retrieve more information about the cause of the connection failure.

Examples
<?php

// The following script connects to a local
// ElevateDB configuration and database, displays
// the configuration path using the edb_connset()
// function, and then disconnects using the edb_disconnect()
// function

$con = edb_connect("type=local;charset=Ansi;configpath=C:\\Tutorial;"+
                   "uid=Administrator;pwd=EDBDefault;database=Tutorial");
if (!$con)
  {
  die("Could not connect: " . edb_errmsg());
  }
echo edb_connset($con,"configpath");
edb_disconnect($con);
?>
Image