SQLServer + PHP.ini

I'm trying to create a PHP connecting to SQL Server 2008 but the server returns the following error:

Fatal error: Call to undefined function mssql_connect () 

Looked in many places and they all say to go in PHP.ini and uncomment the line:

extension = php_mysql.dll 

But my php.ini file doesn't have this line.

This is my current code, but I've tried several others:

<? php 
mssql_connect ("192.168.2.7", "sa", "5c n9r1n7 @ # @ dm") or die ("Could not connect to server"); 
mssql_select_db ("fd_585b0f87") or die ("Unable to select database"); 
mssql_close (); 
print "Connection OK"; 
> 

I've tried this also:

<? php 
$ server = "192.168.2.7"; 
$ database = "fd_585b0f87"; 
$ user = "sa"; 
$ password = "5c n9r1n7 @ # @ dm"; 


$ conn = mssql_connect ($ server, $ user, $ password); 
$ conn = mssql_select_db ("$ database", $ connection); 


if ($ conn) {
echo "One connection"; 


} 
> 

Anyone know any way to fix this error? thank you

You want to uncomment the line:

;php_mssql.dll

Not

;php_mysql.dll 

One is for Microsoft SQL Server (php_mssql.dll) whilst the other is for MySQL (php_mysql.dll).

If that fails, you probably don't have the MSSQL drivers installed. This link provides instructions on how to install the MSSQL drivers which will enable you to interface with MSSQL from within your PHP script.