I've tried EVERYTHING!

I connected to Oracle 11g1 and MySQL 5.0.x under Fedora 9 with few problems.

Now I am trying to connect to SQL Server 2005 on XP Prof via the following code!

<?php
// Server in the this format: <computer><instance name> or
// <server>,<port> when using a non default port number
// $server = 'LANDON\SQLEXPRESS';
// $server = '(local)\sqlexpress';
$server = '.\sqlexpress';
$link = mssql_connect($server, 'sa', 'xoxoxoxox');

if(!$link)
{
die('Something went wrong while connecting to MSSQL');
}
?>

Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: .\sqlexpress in C:\Inetpub\wwwroot\trymssql.php on line 7

Fatal error: Maximum execution time of 60 seconds exceeded in C:\Inetpub\wwwroot\trymssql.php on line 7

I just loaded PHP 5.2.6 and have been over the php.ini file 100 times.

I've set the path to the php directory.

I am able to do the phpinfo() vi the browser!

<?php
phpinfo();
?>

Using MS C# code I have been able to query tables in the SQL Server 2005.

Next I'll scour the phpinfo page for any clue and wade into the security settings!

MS docs go in circles!

I've searched for permission problems with XP Prof.

I am using windows authentication!

I haven't found any requirement to add anything surrounding code in this forum.

    Tom thanks for the response...please remove my post in answer to your post

    it is not showing up yet 10 minutes after post...thanks!

      9 days later

      from the forums
      php-db@lists.php.net

      php-windows@lists.php.net

      --- On Sat, 12/20/08, Fergus Gibson <fgibson75@gmail.com> wrote:

      From: Fergus Gibson <fgibson75@gmail.com>
      Subject: Re: [PHP-DB] ntwdblib.dll not found in any of the 5.2.8 zip files
      To: fredsilsbee@yahoo.com
      Date: Saturday, December 20, 2008, 6:06 PM
      On Sat, Dec 20, 2008 at 7:59 AM, Fred Silsbee
      <fredsilsbee@yahoo.com> wrote:

      ntwdblib.dll proves to be necessary...otherwise
      I'll get a mssql_connect not found
      I used the ntwdblib.dll file from a 5.2.6 zip file

      This resource might help:

      http://www.userscape.com/helpdesk/index.php?pg=kb.page&id=13

      According to the information there and on the forum thread
      they link,
      the problem you have is likely that the ntwdblib.dll is the
      wrong
      version. They say you can find the correct DLL in the
      system32
      directory on the SQL Server. If you copy that to your
      extension dir,
      you should be good.

      YOU ARE THE MAIN MAN! THAT WORKED! THE CORRECT VERSION SHOULD BE

      INCLUDED IN THE 5.2.8 ZIP FILE

      Here is my code:

      <?php
      // Server in the this format: <computer><instance name> or
      // <server>,<port> when using a non default port number
      $server = "LANDON\SQLEXPRESSLMKIII";
      //$server = '(local)';
      //$server = '.\SQLEXPRESSLMKIII';
      $link = mssql_connect($server, "sa", "x0x0x0x0x0x0x0");
      //$link = mssql_connect($server);

      if(!$link)
      {
      die('Something went wrong while connecting to MSSQL');
      }
      else
      {
      echo ("made it");
      }
      ?>

      I connected without many problems to MySQL and Oracle 11g1 under Fedora 9

        Landon -

        Thanks for posting the solution. Marking thread as resolved.

        -Tom

          Write a Reply...