$conn = @mssql_connect ("127.0.0.1", "sa", "database") or Die ("Connection error");
mssql_select_db ("test") or Die ("without this Database");
$sql = "SELECT * from Login";
$result =mssql_query ($sql);
while ($row =mssql_fetch_assoc ($result))
{
echo $row [' ID ']. " ". $row [' User '].
";
}
Mssql_close ($conn);
//==========================================================
PHP connection to SQL Server
Modify PHP.ini
1. Remove the extension=php_mssql.dll before;
2. Confirm that Extension_dir is the correct path, take this machine as an example: Extension_dir = "C:\php\extensions"
OK, restart the server, test ing ...
If not, try the following methods:
PS: In the classmate several computers are tested pass, but in the self machine report wrong said to find C:\php\extensions\php_mssql.dll but clearly exist this file.
Workaround:
Put the Php_mssql.dll,ntwdblib.dll in the system directory \system32 restart the test ...
(Note: The above two DLL files are not in the same directory, please self-lookup.) ^_____^)