tamilmani Posted April 29, 2010 Share Posted April 29, 2010 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 Quote Link to comment Share on other sites More sharing options...
siric Posted April 29, 2010 Share Posted April 29, 2010 Have you stopped and restarted the webserver after you made the change in the php.ini file? Quote Link to comment Share on other sites More sharing options...
tamilmani Posted April 29, 2010 Author Share Posted April 29, 2010 Yes i have restarted my web server . But there is no use . Ï am getting same error message Quote Link to comment Share on other sites More sharing options...
siric Posted April 29, 2010 Share Posted April 29, 2010 Run a phpinfo script to ensure that the mssql is showing up as being loaded <?php phiinfo(); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.