Jump to content

php mssql connection


tamilmani

Recommended Posts

Hi All,

 

I have faced one issue in php . I need to connect the SQL server using php code . My sample code is

<?php
$myServer = "localhost";
$myUser = "username";
$myPass = "psssword";
$myDB = "my_db";

//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
  or die("Couldn't connect to SQL Server on $myServer");

//select a database to work with
$selected = mssql_select_db($myDB, $dbhandle)
  or die("Couldn't open database $myDB"); 
  ?>

 

If i run the above code , i am getting error message

Fatal error: Call to undefined function mssql_connect() in C:\wamp\www\mssql.php on line 8

 

Step are dones

1. uncommented the extension=php_mssql.dll line in php.ini

2. Loaded the newtlib.dll file

 

But still i am getting error message.

 

Thanks

Tamilmani Mohan

 

Link to comment
https://forums.phpfreaks.com/topic/200141-php-mssql-connection/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.