ID: 15400
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Open
+Status: Closed
Bug Type: MSSQL related
Operating System: Windows 2000
PHP Version: 4.1.1
New Comment:
Excellent.. this works... Thanks Adrian..
Ok you can close this now.. :)
Previous Comments:
------------------------------------------------------------------------
[2002-03-27 06:38:39] [EMAIL PROTECTED]
*** SOLVED ***
If the configuration option "mssql.compatability_mode" is missing, then
php_mssql fails to initialize the procedure pointer for
"get_column_content". Looks like a bug, but can be avoided simply by
adding the configuration option:
mssql.compatability_mode = Off
May be it is the best to take php.ini-dist and copy the full [MSSQL]
section in your active php.ini.
Cheers,
Adrian
------------------------------------------------------------------------
[2002-03-27 04:53:34] [EMAIL PROTECTED]
The crash occurs only if the query returns any records.
The following example crashes on the last query. All others run fine
(appropriate access rights assumed ;-)
<?
mssql_connect()
or die ("Cannot open mssql\n");
@mssql_query("DROP DATABASE test");
mssql_query("CREATE DATABASE test")
or die ("Cannot create database\n");
mssql_select_db ("test")
or die ("Cannot select database\n");
mssql_query("CREATE TABLE foo (bar int)")
or die ("Cannot create table\n");
mssql_query("INSERT INTO foo (bar) VALUES (1)")
or die ("Cannot insert into table\n");
$res = mssql_query ("SELECT * FROM foo WHERE bar=2")
or die ("DB error\n");
echo "Before crashing query\n";
$res = mssql_query ("SELECT * FROM foo")
or die ("DB error\n");
?>
Using NT4 SP5 and tried with both PHP4.1.1 and 4.1.2
------------------------------------------------------------------------
[2002-03-13 14:14:25] [EMAIL PROTECTED]
The same problem. Win2K Pro, PHP 4.1.2
===PHP.INI
error_reporting= E_ALL; display all errors, warnings and notices
enable_dl=on
extension_dir=c:\php\extensions
extension=php_mssql.dll
===
<?php
$h = mssql_connect("nest.rtsnet.ru,1433", "wwwuser", "***");
mssql_select_db("WebInfo");
$rs = mssql_query("SELECT * FROM foo");
?>
Running from command line or as CGI results in the fatal application
error. Any bug in query string results in normal PHP error message "MS
SQL: Query failed in ....".
ODBC version works ok.
------------------------------------------------------------------------
[2002-02-06 09:19:17] [EMAIL PROTECTED]
the [] were just there to denote what I was putting into them
------------------------------------------------------------------------
[2002-02-06 09:12:58] [EMAIL PROTECTED]
Well it does...
Tried your way MSSQL_CONNECT("HOST:123", "USER", "PWD");
got
Warning: MS SQL: Unable to connect to server: HOST:123 in
c:\inetpub\wwwroot\hello.php on line 5
Warning: MS SQL message: Login failed for user '(null)'. Reason: Not
associated with a trusted SQL Server connection. (severity 14) in
c:\inetpub\wwwroot\hello.php on line 6
Warning: MS SQL: Unable to connect to server: (null) in
c:\inetpub\wwwroot\hello.php on line 6
Warning: MS SQL: A link to the server could not be established in
c:\inetpub\wwwroot\hello.php on line 6
Warning: MS SQL message: Login failed for user '(null)'. Reason: Not
associated with a trusted SQL Server connection. (severity 14) in
c:\inetpub\wwwroot\hello.php on line 7
Warning: MS SQL: Unable to connect to server: (null) in
c:\inetpub\wwwroot\hello.php on line 7
Warning: MS SQL: A link to the server could not be established in
c:\inetpub\wwwroot\hello.php on line 7
Tried MSSQL_CONNECT("HOST,123", "USER", "PWD");
and it crashes... with error stated in first posting
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/15400
--
Edit this bug report at http://bugs.php.net/?id=15400&edit=1