[freetds] Re: Unable to connect to MS SQL 2000

rconner at commspeed.net rconner at commspeed.net
Thu Mar 25 02:39:19 EST 2004


Thanks for the reply.  I am jost sure I understand what you mean however. 
I understand the .conf information.  Your saying make it like so
------------------
# A typical Microsoft SQL Server 2000 configuration
[myserver]
        host = myserver
        port = 1433
        tds version = 4.2
---------------------------


However what are you saying I need to do to the php code? this is what I
have.  Please edit it as you mean. So i understand.

--------------------
<?php

$myServer = "myserver";
$myUser = "myuser";
$myPass = "mypass";
$myDB = "mydb";


$s = mssql_connect("myserver", "$myUser", "$myPass")
or die("Couldn't connect to SQL Server on $myServer");
echo "Connected(1)";

$d = mssql_select_db($myDB, $s)
or die("Couldn't open database $myDB");
echo "Connected(2)";

$query = "SELECT whatever
          FROM there";

$result = mssql_query($query);
$numRows = mssql_num_rows($result);

echo "This a test";

while($row = mssql_fetch_array($result))
{
  echo "<br>$row[0]</br>";
}

?>
----------------


Thanks very much for the interest

Ryan




>
> On Mar 24, 2004, at 21:26, rconner at commspeed.net wrote:
>
> make sure the string specified in $myServer...
>
>> $myServer = "myserver";
>
> is the name of a section with the correct information in freetds.conf...
>
>> # A typical Microsoft SQL Server 2000 configuration
>> [MyServer2k]
>>         host = myserver
>>         port = 1433
>>         tds version = 4.2
>
>
> for example if $myServer is set to "myserver" there should be a section
> titled "[myserver]"
>
> You specify the hostname in the freetds conf. You don't tell the
> hostname to mssql_connect(). It's the .conf section name you have to
> use there.
>
> --
> fds
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>




More information about the FreeTDS mailing list