2

I am getting this error from the following code:

$result = odbc_connect("DRIVER={MySQL ODBC 3.51 Driver};Server=localhost;Database=$database_name",$database_username, $database_password);

Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /dbconnect.php on line xx odbc not connected

I am using MySQL version 5.1.41-3ubuntu12.3

My phpinfo gives the following output:

Additional .ini files parsed /etc/php5/apache2/conf.d/odbc.ini, /etc/php5/apache2/conf.d/pdo_odbc.ini  

odbc
----

ODBC Support            enabled <br>
Tomas
  • 57,621
  • 49
  • 238
  • 373
Ozair Kafray
  • 13,351
  • 8
  • 59
  • 84

1 Answers1

3

You must have an ODBC driver installed. http://packages.ubuntu.com/hardy/unixodbc

bcosca
  • 17,371
  • 5
  • 40
  • 51