Page 1 of 1

MS connect eoor

Posted: Mon Mar 15, 2010 9:29 am
by deshmukh999
Hi,

I want access data from MS-sql database.


I inatalled sql server 2005 express edition 2005 and WAMP.

Facing problem when I am making connection.

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

Please help get it solve.
I wrote below for making connection..
<?php
$msServer = "192.168.2.16";//
$msUser = "user";
$msPass = "user@123";
$msDB = "AttendanceTesting";

//connection to the database
$mslink = mssql_connect($msServer,$msUser,$msPass)
or die("Couldn't connect to SQL Server on $myServer");

//select a database to work with
$msdb = mssql_select_db($msDB, $mslink)
or die("Couldn't open database $myDB");
//declare the SQL statement that will query the database

$squery = "select * from tblUser";

//execute the SQL query and return records
$result = mssql_query($query);

$numRows = mssql_num_rows($result);
echo "<h1>" . $numRows . " Returned </h1>";
?>

Re: MS connect eoor

Posted: Mon Mar 15, 2010 9:39 am
by papa
You need to enable the extension in php.ini

Re: MS connect eoor

Posted: Tue Mar 16, 2010 8:37 am
by deshmukh999
Not conecting to mssql
I am using XAMPP1.7.3
I downloaded php_mssql.dll and ntwdblib.dll and copied in
C:\xampp\php\ext

I did the following changes in C:\xampp\php\php.ini file
uncommented following lines

extension_dir = "C:\xampp\php\ext"
extension=php_msql.dll
mssql.allow_persistent = On
mssql.secure_connection = On

After this I restarde Xampp server and got th efollowing warning message.

PHP startup : Unable to load dynamic library 'C:\xampp\php\ext\php_mssql.dll' -The specified modulw is not be found.

Please help me to get it resolve.
first | < previous | next > | last