odbc_connect

resource odbc_connect(string DSN, string user, string pass, int [cursor]) 
DSN DSN (Data Source Name)
user Username
pass Password
cursor Cursor type

Connects to an ODBC data source.

Returns:

Connection ID; FALSE on error

Description:

Creates a connection to the specified database using an optional username and password. If a username and password are unnecessary, use empty quotes rather than omitting the parameters. The cursor type is optional but useful for dealing with some ODBC where a cursor type is needed—for example, to return the number of rows from a query.

The cursor types are SQL_CUR_USE_IF_NEEDED, SQL_CUR_USE_ODBC, SQL_CUR_USE_DRIVER, and SQL_CUR_DEFAULT.

Version:

Existing since version 3.0.6

Example:

Connect to ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.