|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-12-03 12:07 UTC] fmk@php.net
[2003-10-31 08:41 UTC] adimuraru at rdslink dot ro
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 05:00:01 2025 UTC |
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?