September 2001
Intermediate to advanced
768 pages
32h 45m
English
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:
Read now
Unlock full access