Jump to content

mssql select query hang


cpusl

Recommended Posts

Hi guys,

 

I am currently doing a project that connects to a mssql server and we finally got this sucker connected using a dsn and odbc_connect. I have the ability to call odbc_data_source and all other functions that query the server but I am having an issue with odbc_exec hanging. When I construct the query wrong, I get back a result saying that the query is wrong eg. table doesn't exist, error at from line 2, etc... However, any query that I do hangs. Even extremely simple ones get a timeout. I simplified it into a simple code base to show you an example:

 

 

$username = "blah";

$password = "blah2";

 

$connection = odbc_connect('myDSN', $username, $password);

 

$results = odbc_exec($connection,'Select TOP 1 firstnamemi from crname;');

 

odbc_close($connection);

 

running this code gets me the hourglass and after about 30 secs or so, a timeout message in the browser.

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/225966-mssql-select-query-hang/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.