I have setup php/linux/mssql and everything works execpt the MS SQL
connection. I don't get any errors returned to me, but it doesn't
connect. As far as I can tell it doesn't even try, but I can't tell at
what point it is breaking. I have used the freetds 0.51 libs to make
this connection since I can't get the sybase libs. Here is what I have
installed
php-4.0.4pl1
apache_1.3.14
freetds-0.51
mysql-3.22.32 (connection to mysql works fine)
On a remote site I have MS SQL server 2000 installed
I'm trying to connect using the following code
#####################################################
<?
// YOUR MSSQL 7.0 SERVER PARAMETERS
error_reporting(E_ALL);
$hostname = "sqla";
$username = "test";
$password = "test123";
// YOUR MSSQL 7.0 DATABASE
$dbname = "northwind";
$tablename = "catagories" ;
// CONNECT TO THE MSSQL 7.0 DATABASE
$connection = mssql_connect($hostname,$username,$password);
mssql_select_db($dbname);
$sql_query = "select * from $tablename" ;
$query_result =mssql_query($sql_query) ;
$number_rows = mssql_num_rows($query_result) ;
$number_fields = mssql_num_fields($query_result) ;
// TEST YOUR QUERY
if($number_rows == 0) :
print "
The query does not produce any data row !
" ;
elseif ($number_rows > 0) :
print "
Yes there are " . $number_rows . " rows resulting from the query.
" ;
endif ;
#############################################################
Here is my interfaces file from the /usr/local/fretds/ dir
#############################################################
myserver2
query tcp ether 127.0.0.1 4001
master tcp ether 127.0.0.1 4001
sqla
query tcp ether 10.0.10.1 1433
master tcp ether 10.0.10.1 1433
###########################################################
Am I missing any thing? Like I said no error on connect but here is
what I get when I try run that page
############################################################
Warning: Sybase: A link to the server could not be established in
/home/vpopmail/web/mssql2.php on line 15
Warning: -1 is not a Sybase link index in /home/vpopmail/web/mssql2.php
on line 17
Warning: 0 is not a Sybase result index in /home/vpopmail/web/mssql2.php
on line 18
Warning: 0 is not a Sybase result index in /home/vpopmail/web/mssql2.php
on line 19
The query does not produce any data row !
###############################################################
So I don't get an error until I try to select a db. I run tcpdump at
the same time just to make sure that it wasn't trying to connect to the
remote server and there was no attempt to even make a connection.
Anyone have any ideas
Miles Scruggs
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]