1
I’m trying to connect to a microsoft sql server database using php. The php version is:
PHP Version 5.6.3
and the error that gives is
Fatal error: Call to Undefined Function mssql_connect() in C: xampp htdocs Aloha.php on line 7**
I tried to use the command:
<?php
$myServer = "server";
$myUser = "user";
$myPass = "senha";
$myDB = "mydb";
$conn = mssql_connect($myServer,$myUser,$myPass);
if (!$conn)
{
die('Not connected : ' . mssql_get_last_message());
}
$db_selected = mssql_select_db($myDB, $conn);
if (!$db_selected)
{
die ('Can\'t use db : ' . mssql_get_last_message());
}
?>
However it is a mistake, because it seems that my PHP is not configured to connect.
I went in php.ini and uncommented the
extension=php_mssql.dll
but it still didn’t work.
The data from phpinfo found too large to post here, so if you need any specific data ask here.
Vc is using microsoft’s Extension:?
– Ricardo
Can’t use another API, like PDO or sqlsrv? is connection to SQL Server 7 or 2000?
– rray
I’m not using microsoft’s Extension, but I can use another API if you can give me a solution. I just want to make the connection (It doesn’t matter which function to use.
– Felipe Jorge