Re: PHP + ODBC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Dec 15, 2009, at 9:50 AM, Richard Quadling wrote:

> 2009/12/15 Philip Thompson <philthathril@xxxxxxxxx>:
>> On Dec 14, 2009, at 8:47 PM, James McLean wrote:
>> 
>>> On Tue, Dec 15, 2009 at 10:03 AM, Philip Thompson
>>> <philthathril@xxxxxxxxx> wrote:
>>>> My head hurts from hitting it on my desk all day, so I thought I'd turn to a fresher set of eyes. The issue I'm having is getting PHP to connect ODBC. I can get it to work using isql from the command line. Can you verify my settings....:
>>>> 
>>> [snipped]
>>>> 
>>>> I've tried the above DSNs and many other versions of it ad nauseum. The specific error I'm getting is... "[unixODBC][Driver Manager]Data source name not found, and no default driver specified." I really have searched high and low for a solution, but to no avail. Any thoughts?
>>> 
>>> Why not just use the built in MySQL libraries or PDO?
>> 
>> Oh, that would be "my" preference. However, the database that I really need to connect to is an MSSQL one and the allowed connection type is ODBC. I was just testing first with a MySQL connection to get it working (I don't have the MSSQL credentials yet). Turned out I was VERY close with my solution, which a coworker figured out this morning. The [ODBC Data Sources] entry for MySQL needed to specified correctly in /etc/odbc.ini.
>> 
>> [ODBC Data Sources]
>> MySQL = MySQL
>> 
>> [MySQL]
>> Description...
>> Driver...
>> 
>> I could have sworn I tried that, but who knows....
>> 
>> Thank you!
>> ~Philip
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>> 
> 
> You can use a DNS-string too ...
> 
> odbc_pconnect("Driver={SQL Server Native Client
> 10.0};Server={$s_Server};Database={$s_DB};MARS_Connection=Yes;",
> $s_User, $s_Pswd, SQL_CUR_USE_DRIVER);

I'm actually using a combination of the DSN*-string and the odbc.ini settings. Thank you!

~Philip 
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux