AIX+PHP+FREETDS

André allquadros at ig.com.br
Wed Oct 30 07:41:57 EST 2002


Ok Nicholas,

  I install the last snapshot version and now the test using dblib is Ok.
But my next problem is the access MSSQL Server using PHP. When try it I
receive the following error:


Warning: 0 is not a Sybase link index in /www/teste/mssql.php on line 7

Warning: 0 is not a Sybase link index in /www/teste/mssql.php on line 11

Warning: 0 is not a Sybase result index in /www/teste/mssql.php on line 13

  I used the SqlServer functions of PHP, see the code.

<?php 
//connect to database server 
$db_conn = mssql_connect("99.99.99.99:1433","user","password");
// or die( "ERROR: Connection to SPHINX1 failed" ); 
//select database - only if we want to query another database than the
default one
mssql_select_db( "Northwind", $db_conn ); 

//or die( "ERROR: Selecting database failed" ); 
//query the database 

$query_result = mssql_query( "SELECT ProductID FROM Products", $db_conn );
//or die( "ERROR: Query failed" ); 

$daten = mssql_fetch_array($query_result);
?> 
<html> 
<head> 
<title>Untitled Document</title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
</head> 
<body bgcolor="#FFFFFF" text="#000000"> 
<?php echo $daten["ProductID"]; ?> 
</body> 
</html> 

Do you have any idea ? 
thanks,
André






More information about the FreeTDS mailing list