|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-11-29 12:13 UTC] fmk@php.net
[2000-11-29 20:18 UTC] lingc at mail dot nsysu dot edu dot tw
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 04:00:01 2025 UTC |
I need to exec my sql statement with "set nocount on" and "set nocount off" within the for-loop by the function of mssql_query. But it seems only to be successful at the first time and the others were failed with the error message "MSSQL Query Failed". My platform is WinNT4.0sp4+Apache1.3.14+Php4.03pl1+MSSQL7.0sp2. The sql-statement is <pre> $db = mssql_connect("test","",""); for ($i=0;$i<=3;$i++){ $SQLstr = "set nocount on select news from table_news set nocount off"; $result = mssql_query($SQLstr,$db); print $result; } mssql_close($db); ======================== The result is: 1 Warning: MS SQL: Query failed in c:\test.php3 on line 16 Warning: MS SQL: Query failed in c:\test.php3 on line 16 </pre> I use the mssql profiler to trace the execution. I found that the sql statement was only executed at the first time and another times were not found. Is this is a bug of mssql_query ? Thanks anyway, Vicent,Lin.