Skip to Content.
Sympa Menu

freetds - [freetds] Connection issue

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Chris parent <kireol AT yahoo.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Connection issue
  • Date: Mon, 13 Jun 2005 23:31:23 -0700 (PDT)

I've ran into this problem before. The scary part is
last time it "fixxed itself".

Well, the HD went on my linux box. So I reinstalled
everything.

tsql works just fine from the command line
/usr/local/freetds/bin/tsql -S server -U
'abstract\abstractweb' -P 'mypass'
locale is "en_US"
locale charset is "ISO-8859-1"
1>

but my test program in PHP does not

--------------------------------code------------------
<?php
$mssqlNTLogin ='abstract\abstractweb';
$mssqlNTPassword = 'mypass';
$conn = mssql_connect('server', $mssqlNTLogin,
$mssqlNTPassword);
mssql_select_db('[proform]', $conn);
$query = "SELECT count(*) from search";
$result = mssql_query ($query) or die("Query
failed : ".mssql_error());
while ($line = mssql_fetch_array($result))
{
$count = $line[0];
print "$count<BR>";
}
mssql_close($conn);
?>
----------------------------end code------------------

result from web page

Warning: mssql_connect(): Unable to connect to server:
server in /www/htdocs/feesheet/test.php on line 5

This same error also happens if I run the php script
from the command line via php binary with "php
test.php"

I'm showing that I compiled PHP with the same location
that I'm calling tsql from:
'--with-mssql=/usr/local/freetds'


I'm running on Debian Linux.


Why is it that tsql command line runs fine but not my
web PHP version? It's almost as if that the PHP
version doesnt know where or how to find my
freetds.conf file.



__________________________________
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html





Archive powered by MHonArc 2.6.24.

Top of Page