![]() |
|
PHP ODBC. Free online PHP and MySQL Web Database Programming Tutorial... |
| Lessons | PHP with ODBC 1 |
|
|
How to Create an ODBC Connection? With the help of an ODBC connection, we can connect to any database, on any computer in our network, as long as an ODBC connection is available. Just follow the below mentioned steps to create an ODBC connection to a MS Access Database:
Connecting to an ODBC Data Source The odbc_connect() function is used to connect to an ODBC data source. This function takes four parameters: the data source name, username, password, and an optional cursor type. The odbc_exec() function is used to execute an SQL statement. PHP ODBC Example The following code example creates a connection to a DSN called northwind, with no username and no password and then it creates an SQL and executes it: $conn=odbc_connect('northwind','',''); $sql="SELECT * FROM customers"; $rs=odbc_exec($conn,$sql);
Next: PHP MySQL ODBC 2
|