|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-02-12 10:37 UTC] sniper@php.net
[2004-02-12 14:39 UTC] willy at vuboys dot nl
[2004-03-18 17:46 UTC] fmk@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 18:00:01 2025 UTC |
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