FW: [PHP-DB] php/linux/mssql

From: Date: Mon, 19 Mar 2001 17:16:55 +0000
Subject: FW: [PHP-DB] php/linux/mssql
Groups: php.db 
Request: Send a blank email to php-db+get-7608@lists.php.net to get a copy of this message
Well from what I can tell php treats sybase and mssql the same. Am I wrong on this, or how do I fix this? Miles Scruggs > > Im not an expert on MS SQL, but from the looks of things, PHP thinks you > are > using the Sybase libs instead of the freetds ones, hence why it's saying: > > "Warning: -1 is not a Sybase link index in /home/vpopmail/web/mssql2.php > on line 17"......................... > > Just a thought, again, I'm not the expert on this particular subject, I'm > just going by what I see. > > --- David Balatero > > Miles Scruggs wrote: > > > 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: php-db-unsubscribe@lists.php.net > > For additional commands, e-mail: php-db-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#7608) next »