note 76141 added to function.mssql-connect
| From: | AndersSimonsen at osu1 dot php dot net | Date: | Mon, 02 Jul 2007 16:21:34 +0000 |
| Subject: | note 76141 added to function.mssql-connect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128159@lists.php.net to get a copy of this message | ||
Finally, I made it work... Using Windows 2003, ISS 6.0, PHP5-CGI and SQL express
It's a good idea to set your environment variables to path=%path%;c:\php and phprc=c:\php
first.
1. Fire up SQL Server Configuration Manager
2. Drill down to "Protocols for SQLEXPRESS"
3. Enable Named Pipes (God knows why)
4. Enable TCP, I have everything enabled in the "IP Addresses" tab
5. Restart SQL Express (Or the computer ;)
6. Start SQL Browser service. Remember to set it to automatic.
The final detail is the need to use (host)\SQLEXPRESS in the connection string. This is a little
problematic when using MDB2, but it works if you break the connection string into an array like
this:
$dsn = array(
'phptype' => 'mssql',
'username' => 'user',
'password' => 'yourpass',
'hostspec' => 'localhost\SQLEXPRESS',
'database' => 'yourdb',
);
require_once 'MDB2.php'; $mdb2 =& MDB2::connect($dsn);
if (PEAR::isError($mdb2)) {
echo $mdb2->getUserinfo();
}
Of course, youâll also need extension=php_mssql.dll in the PHP.ini and that ntwdblib.dll
2000.80.194.0 file mentioned bellow.
Have fun
----
Server IP: 128.39.198.38
Probable Submitter: 84.202.50.117
----
Manual Page -- http://www.php.net/manual/en/function.mssql-connect.php
Edit -- https://master.php.net/note/edit/76141
Del: integrated -- https://master.php.net/note/delete/76141/integrated
Del: useless -- https://master.php.net/note/delete/76141/useless
Del: bad code -- https://master.php.net/note/delete/76141/bad+code
Del: spam -- https://master.php.net/note/delete/76141/spam
Del: non-english -- https://master.php.net/note/delete/76141/non-english
Del: in docs -- https://master.php.net/note/delete/76141/in+docs
Del: other reasons-- https://master.php.net/note/delete/76141
Reject -- https://master.php.net/note/reject/76141
Search -- https://master.php.net/manage/user-notes.php