Fatal error: Call to undefined function mssql_connect()
Posted: Sun Aug 21, 2005 2:59 am
Hello,
New to PHP and to the forum. I am developing a commercial website in PHP 5 and have set up a small test network. I have one server running Windows NT 4.0 and ISS 4.0 and another with Microsoft SQL Server 2000 Personal Edition installed. I am doing all my development on a Compaq presario desktop. I successfully installed PHP and everything was going fine until I tried accessing the database. I am getting the following error:
Here is the script:
I have done the following:
1. Installed the SQL Client Tools on the web server
2. Uncommented the line extension=php_mssql.dll in the php.ini file
3. Copied the php_mssql.dll file to the WINNT\System32 directory and the php\ext directory.
I tried running the following script that I found on another forum:
and it printed you do NOT have mssql installed. How do I install it? PHP manual was no help and I couldn't find anything else on this forum that I could use. Only other thing I can think of that I haven't tried yet is recompiling using --with-mssql. But I have no idea how to do that or if it is even neccesary.
Any help would be greatly appreciated.
feyd | Please use
New to PHP and to the forum. I am developing a commercial website in PHP 5 and have set up a small test network. I have one server running Windows NT 4.0 and ISS 4.0 and another with Microsoft SQL Server 2000 Personal Edition installed. I am doing all my development on a Compaq presario desktop. I successfully installed PHP and everything was going fine until I tried accessing the database. I am getting the following error:
Code: Select all
Fatal error: Call to undefined function mssql_connect() in C:\InetPub\wwwroot\Test\test.php on line 7Code: Select all
<?php
$server="DEVSERV,1433";
$username="Administrator";
$password="password";
$sqlconnect=mssql_connect($server, $username, $password);
$sqldb=mssql_select_db("testdb",$sqlconnect);
$sqlquery="SELECT * FROM test;";
$results= mssql_query($sqlquery);
while ($row=mssql_fetch_array($results)){
echo $row['testid']."<br>\n";
}
mssql_close($sqlconnect);
?>1. Installed the SQL Client Tools on the web server
2. Uncommented the line extension=php_mssql.dll in the php.ini file
3. Copied the php_mssql.dll file to the WINNT\System32 directory and the php\ext directory.
I tried running the following script that I found on another forum:
Code: Select all
$ext = get_loaded_extensions();
if(in_array('mssql', $ext))
echo 'you have mssql installed';
else
echo 'you do NOT have mssql installed';Any help would be greatly appreciated.
feyd | Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]