In the ongoing saga to get FreeTDS and/or ODBC to work in PHP/Linux,
connecting to a remote MS SQL Server 2K system...
I decided to try InlineTDS...
I downloaded InlineTDS from http://library.freeodbc.org/ and put the
..so file in /usr/lib. I then added this to my /etc/odbcinst.ini...
[InlineTDS]
Description =
Driver = /usr/lib/odbc-i02.so
Setup = /usr/lib/libodbcmyS.so
FileUsage = 1
CPTimeout =
CPReuse =
....and this to my /etc/odbc.ini...
[odbc2test]
Description = InlineTDS
Driver = InlineTDS
Server = 40.40.40.40
Database = pubs
Port = 1433
Socket =
Option =
Stmt =
....from there, I was able to do...
isql odbc2test sa ''
....and then "select * from authors"...
It worked. I could also pull it open in Tora by connecting to
localhost and setting the database to "odbc2test". That piped to
localhost and then back out to the remote SQL Server.
I could also use ODBCConfig to see the settings were in there
properly.
So, if isql worked, then PHP should surely work with the following,
shouldn't it? I mean, isql is just one knotch above the tsql tool, I
thought.
$conn = odbc_connect('odbc2test','sa','');
....this didn't error out, and proceeds to the next statement just
fine...
$rows = odbc_exec($conn, 'select * from authors');
....but then halts there without an error, and without processing any
more lines -- even echoes -- beneath that line.
I guess you can't get there from PHP. MS SQL and PHP/Linux just don't
seem to mix.
Man, this sucks.