$odbc_id = odbc_connect("myodbc3", "root", "xxxxx");
I get the following result:
Warning: odbc_connect(): SQL error: [MySQL][ODBC 3.51 Driver]Unknown MySQL Server Host 'test2.php' (1), SQL state S1000 in SQLConnect in/Library/Apache2/htdocs/test2.php on line 3
It is attempting to use the filename as the host (test2.php), and obviously failing to resolve it. I have verified that my DSN is correctly configured, as I can make ODBC connections through the CLI odbctest utility and successfully run queries. This also suggests to me that the problem does not lie with the MyODBC driver itself. Furthermore, I have attempted to use mysql_connect(...), which works fine, so I am also ruling out a MySQL configuration issue (such as localhost not being in the grant tables). Does anyone know what else I should be looking for here? I will paste the contents of my odbc.ini file as well if this would help anyone.
Thanks, Andy
; ; odbc.ini configuration for MyODBC and MyODBC 3.51 Drivers ;
[ODBC Data Sources] myodbc3 = MySQL ODBC 3.51 Driver DSN
[myodbc3] Driver = /Library/MyODBC/lib/libmyodbc3.bundle Description = MySQL ODBC 3.51 Driver DSN SERVER = localhost USER = root Password = xxxxx Database = test
[Default] Driver = /Library/MyODBC/lib/libmyodbc3.bundle Description = MySQL ODBC 3.51 Driver DSN SERVER = localhost USER = root Password = xxxxx Database = test
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php