odbc_connect()
odbc_connect - Connect to a datasource
Syntax
resource odbc_connect (
string $dsn,
string $user,
string $password,
int $cursor_type)
Arguments
- dsn - The database source name for the connection. Alternatively, a DNS-less connection string can be used.
- user - The username.
- password - The password.
- cursor_type - This sets the type of cursor to be used for this connection. This parameter is not normally needed, but can be useful for working around problems with some ODBC drivers. The following constants are defined for cursortype: SQL_CUR_USE_IF_NEEDED SQL_CUR_USE_ODBC SQL_CUR_USE_DRIVER
Description
The connection id returned by this functions is needed by other ODBC functions. You can have multiple connections open at once as long as they either use different db or different credentials.
Version
PHP 4, 5
Return value
Returns an ODBC connection id or 0 ( FALSE) on error.