locked
Timeout expired RRS feed

  • Question

  • Dear Sir,
    thank you for your reply
    I have a problem when trying to connect to sql from PHP (ODBC_Connect function)
    I have a script, connecting to sql server through odbc_connect function, when i run this program sometimes it gives me :
    SQL error[Microsoft][ODBC SQL Server Driver] TimeOut expired SQL State S1T00..

    and sometimes it runs without any problem

    if anyone can gives me an idea to what is happening..and what shall i do to prevent it from timing out.

    thanks  a lot

    Best Regards.

    suzi
    Friday, December 12, 2008 10:05 AM

Answers

  •  The odbc_connect is part of the generic ODBC PHP extension.  We have a new extension written specifically for SQL Server, called the SQL Server Driver for PHP (sqlsrv).  Try using it and seeing if it resolves this problem.

    To connect to SQL Server using the sqlsrv driver, use the sqlsrv_connect function.

    There are two versions of the driver included in the extraction (installation) package.  php_sqlsrv.dll is for non-threaded versions of PHP 5.2.x and php_sqlsrv_ts.dll is for the threaded versions of PHP 5.2.x.

    Hope this helps.


    Jay Kint MSFT
    Tuesday, March 3, 2009 7:53 PM

All replies

  •  The odbc_connect is part of the generic ODBC PHP extension.  We have a new extension written specifically for SQL Server, called the SQL Server Driver for PHP (sqlsrv).  Try using it and seeing if it resolves this problem.

    To connect to SQL Server using the sqlsrv driver, use the sqlsrv_connect function.

    There are two versions of the driver included in the extraction (installation) package.  php_sqlsrv.dll is for non-threaded versions of PHP 5.2.x and php_sqlsrv_ts.dll is for the threaded versions of PHP 5.2.x.

    Hope this helps.


    Jay Kint MSFT
    Tuesday, March 3, 2009 7:53 PM
  • As Jay points out, this is forum is specifically to help PHP developers working with the Microsoft SQL Server Driver for PHP, which uses the function prefix sqlsrv_.

    We invite you to go to the announcement that Jay referenced above to download the extension and try using it to talk to your SQL Server database from your PHP code.

    David Sceppa
    Program Manager - SQL Server Driver for PHP
    Monday, March 9, 2009 5:44 PM