#27204 [Fbk->Opn]: Queries fail after sp_help
| From: | willy at vuboys dot nl | Date: | Tue, 10 Feb 2004 13:13:28 +0000 |
| Subject: | #27204 [Fbk->Opn]: Queries fail after sp_help | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-54687@lists.php.net to get a copy of this message | ||
ID: 27204
User updated by: willy at vuboys dot nl
Reported By: willy at vuboys dot nl
-Status: Feedback
+Status: Open
Bug Type: MSSQL related
Operating System: Windows XP SP1
PHP Version: 4.3.4
New Comment:
Same problem with this latest stable.
Previous Comments:
------------------------------------------------------------------------
[2004-02-10 08:06:00] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2004-02-10 06:23:35] willy at vuboys dot nl
Description:
------------
After you run mssql_query("sp_help") all following queries fail. I am
using PHP4.3.4 running as ISAPI module in IIS5 on Windows XP. SQL
Server 2000, version 8.00.760.
When you uncomment both lines in the reproduce script:
while (mssql_next_result($result));
mssql_free_result($result);
the script does work.
Reproduce code:
---------------
if ( ! $connect_id = mssql_connect( $sql_host,$sql_user,$sql_pass ) )
{
die("Could not create a MSSQL connection, please check the SQL values
entered");
}
if ( ! mssql_select_db($sql_database, $connect_id) )
{
die("MSSQL could not locate a database called
'{$VARS['sql_database']}' please check the value entered for this");
}
$result = mssql_query("SELECT @@VERSION");
$row = mssql_fetch_row($result);
echo $row[0]."<br />";
$result = mssql_query("sp_help", $connect_id);
while ($table = mssql_fetch_array($result))
{
if (($table[2]=="user table") && (!($table[0]=="dtproperties"))) {
echo $table[2]." | ".$table[0]."<br />";
}
}
// while (mssql_next_result($result));
// mssql_free_result($result);
$result = mssql_query("SELECT @@VERSION");
$row = mssql_fetch_row($result);
echo $row[0]."<br />";
mssql_close($connect_id);
?>
Expected result:
----------------
Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation Personal Edition on
Windows NT 5.1 (Build 2600: Service Pack 1)
user table | table 1
...
user table | table n
Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation Personal Edition on
Windows NT 5.1 (Build 2600: Service Pack 1)
Actual result:
--------------
Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation Personal Edition on
Windows NT 5.1 (Build 2600: Service Pack 1)
user table | table 1
...
user table | table n
Warning: mssql_query(): Query failed in c:\inetpub\wwwroot\testsql.php
on line 33
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27204&edit=1