Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Hey there folks...

I am hoping someone can give me a clue here.

I need to get php working with an MS-SQL server, yeah I know....

I have FreeTDS installed, unixODBC and PHP is built with ODBC.

The server is SLES1- SP1

I can get to the server, run queries, add create and drop tables, etc.
etc. from both:

tsql -S servername -U username -P password

isql -v System-DSN username password.

 From within PHP I can:

$conn = odbc_connect(DSN,Username,Password);

odbc_exec(,$conn,'use database');

I can iterate through the tables using odbc_tables($conn) from both the
command line, eg: php5 sqltest.php and from a web interface.  This all
works fine.

No when I try to do something as simple as:

$conn = odbc_connect(DSN,Username,Password);

$result = odbc_exec(,$conn,'select count(*) from sysobjects');

The whole thing just goes away and never comes back.  I would love to
lay this at the feet of MS-SQL but I am thinking its a PHP odbc problem.

Any clues out there??

- Crazy

Site Timeline