I'm trying to create a PHP connection with SQL Server 2008 but the server returns the following error:
Fatal error: Call to undefined function mssql_connect()
I searched in many places and they all say to go in PHP.ini and remove comment from the line:
extension=php_mssql.dll
But my php.ini file does not have this line.
This is my current code, but I've tried several more:
<?php
mssql_connect("192.168.2.7", "sa", "5c@n9r1n7#@dm") or die("Não foi possível a conexão com o servidor");
mssql_select_db("fd_585b0f87") or die("Não foi possível selecionar o banco de dados");
mssql_close();
print "Conexão OK";
?>
I've tried this too:
<?php
$server = "192.168.2.7";
$banco="fd_585b0f87";
$user ="sa";
$senha="5c@n9r1n7#@dm";
$conexao = mssql_connect($server,$user,$senha);
$conexao = mssql_select_db("$banco", $conexao);
if($conexao){
echo "conexao Certa";
}
?>
Does anyone know of any way to fix this error?