Connecting to a MS SQL Server 2000
It took me a while to figure out, how to connect to a Microsoft SQL Server 2000 with php. In the end, it's very simple:
// The Servername of the SQL Server the instance name of the database
// If you didn't specify an instance name, you can connect using $dbhost="SERVER";
// User is by default "sa" (System Administrator) and the pass is by default empty.
// Default password for user sa is empty...
// Northwind is a database with example tables, i've chosen to select the employees table.
// The connection and database selection functions

// finally the loop with First Name and Last Name
$sql = "SELECT LastName, FirstName FROM Employees ";
$result = mssql_query($sql);
   echo $data['FirstName']." ".$data['LastName']."<br>";

Make sure you have:
A) Installed the extensions php_mssql.dll and php_msql.dll and set them up in php.ini.
B) Activated "mixed authentication mode (Windows/SQL Server)" for your database instance.
If it still doesn't work, ask for with a comment.
admin / Dec 04, 2004
2004 - 2019 /