note 34393 added to ref.mssql
| From: | nogitsune101 at hotmail dot com | Date: | Fri, 25 Jul 2003 16:32:22 +0000 |
| Subject: | note 34393 added to ref.mssql | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-52649@lists.php.net to get a copy of this message | ||
Web Server Type: Windows 2000 Server - IIS 5
SQL Server Type: SQL 2000
-------------------------------------------------
Just thought I would put this up since I saw several people having this issue.
Few things that need to be done to get this to work:
1. Install the MS SQL 2000 Client Tools on your Server
2. Using the "Client Network Utility" set up an Alias
3. Edit your PHP.INI file to include the php_mssql.dll extension file.
4. Restart your IIS Service
If you get a "Access Denied" message you need to go to your "\WINNT\SYSTEM32"
directory and find the "ntwdblib.dll" Add the group "Everyone" to the security
with "Read" and "Read - Execute" access. Then restart your IIS Service again.
Here is a peice of sample code you can use to test your MS SQL access.
// ------------------------------------------------ //
<?php
$msserver="MsServerAlias"; //put your server alias here
$usrname="user"; //put your MS SQL username here
$passwrd="password"; //put your MS SQL password here
$conn=mssql_connect($msserver,$usrname,$passwrd);
if ($conn)
$body.= "<font color='blue'>Connection to $msserver was
successful.</font><hr>";
else
$body.="<font color='red'>Error:
".mssql_get_last_message()."</font><hr>";
$conn=mssql_close();
if ($conn)
$body.= "<font color='blue'>Connection to $msserver was successfully
closed.</font><hr>";
else
$body.="<font color='red'>Error:
".mssql_get_last_message()."</font><hr>";
?>
// ------------------------------------------------ //
----
Manual Page -- http://www.php.net/manual/en/ref.mssql.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34393
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34393&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34393&report=yes