News:

GinGly.com - Used by 85,000 Members - SMS Backed up 7,35,000 - Contacts Stored  28,850 !!

Main Menu

Connecting to an ODBC in PHP

Started by sajiv, Sep 03, 2008, 07:27 PM

Previous topic - Next topic

sajiv


Connecting to an ODBC

The odbc_connect() function is used to connect to an ODBC data source. The 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.

Example
The following example creates a connection to a DSN called northwind, with no username and no password. It then creates an SQL and executes it:

Code:
$conn=odbc_connect('northwind','','');
$sql="SELECT * FROM customers";
$rs=odbc_exec($conn,$sql);


:acumen