Bug #17593: mssql_query doesn't fetch results properly

From: Date: Tue, 04 Jun 2002 10:38:51 +0000
Subject: Bug #17593: mssql_query doesn't fetch results properly
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-9447@lists.php.net to get a copy of this message
From: alexp@mail.lv Operating system: Win2k prof. SP2 PHP version: 4.2.1 PHP Bug Type: MSSQL related Bug description: mssql_query doesn't fetch results properly It seems that mssql_query fails to get results properly after executing some arbitrary queries. <?php mssql_connect(".","login","passwd"); $r1=mssql_query("if object_id('tempdb..#abc') is not null drop table #abc"); $r2=mssql_query("select * from sometable"); $r3=mssql_query("select * from othertable"); ?> ..causes.. Warning: MS SQL error: Attempt to initiate a new SQL Server operation with results pending. (severity 7) in d:\htdocs\t\bug.php on line 4 Warning: MS SQL: Query failed in d:\htdocs\t\bug.php on line 4 Warning: MS SQL error: Attempt to initiate a new SQL Server operation with results pending. (severity 7) in d:\htdocs\t\bug.php on line 5 Warning: MS SQL: Query failed in d:\htdocs\t\bug.php on line 5 ---- First query is correct and executes properly (checked with SQL server profiler running). But 2nd,3rd..n-th fail to execute. Though if I comment out 1st one, others work ok. Another dirty hack to avoid these errors is to embed entire query in exec(""). But then temporary #tables won't be available in next queries. I've found another similar bug in database, #9379. Using sql variables in query causes same weird behaviour... In a few days I will test this script on Linux/apache/php/freedts connecting to same sql database and see if it works. Any ideas? -- Edit bug report at http://bugs.php.net/?id=17593&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=17593&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=17593&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=17593&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=17593&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=17593&r=support Expected behavior: http://bugs.php.net/fix.php?id=17593&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=17593&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=17593&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=17593&r=globals

« previous php.bugs (#9447) next »