Skip to Content.
Sympa Menu

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

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: rconner AT commspeed.net
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Re: Unable to connect to MS SQL 2000
  • Date: Thu, 25 Mar 2004 00:39:19 -0700 (MST)

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
>





Archive powered by MHonArc 2.6.24.

Top of Page