Edit report at https://bugs.php.net/bug.php?id=46262&edit=1
ID: 46262 Comment by: programmer at finner dot de Reported by: manohar dot angani at gmail dot com Summary: FreeTDS error. Status: No Feedback Type: Bug Package: MSSQL related Operating System: Linux PHP Version: 5.2.6 Block user comment: N Private report: N New Comment: Bug still in 5.4. Assuming, $db is a database object which provides a connection via PDO/dblib, try <? $con = $db->connect(); $query = $con->prepare("select id from table where param = ?"); while (true) { $query->bindParam(1, 4711); $query->execute(); while ($row = $query->fetch(PDO::FETCH_ASSOC) { (do something with result) } } ?> If you provide different values at $quer->bindParam(), it works OK, also, if you prepare the query always new within the while loop. If you reuse the prepared query with the same parameter as in the loop before, the mentioned error will occur. Previous Comments: ------------------------------------------------------------------------ [2008-10-21 01:00:00] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ [2008-10-14 00:57:04] ka...@php.net Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2008-10-09 05:55:29] manohar dot angani at gmail dot com Description: ------------ We are using freetds .64 and it gives us an error when the same procedure is invoked twice with the same parameter. Error: the XML response that was returned from the server is invalid. Received: sp_helpconstraint_new mt_cell_pull passed Array ( [0] => 00000 [1] => 0 [2] => (null) [0] (severity 0) [(null)] [3] => 0 [4] => 0 ) <pre>1</pre> sp_columns mt_cell_pull passed sp_helpconstraint_new mt_dimension_selected passed Array ( [0] => 00000 [1] => 0 [2] => (null) [0] (severity 0) [(null)] [3] => 0 [4] => 0 ) <pre>1</pre> sp_columns mt_dimension_selected passed sp_helpconstraint_new mt_cell_pull passed Array ( [0] => HY000 [1] => 20019 [2] => Attempt to initiate a new Adaptive Server operation with results pending [20019] (severity 7) [(null)] [3] => 0 [4] => 7 [5] => Success ) <pre>1</pre> DBEntidad::DBEntidad - tableInfo without data - Table: mt_cell_pull-Query Error: Attempt to initiate a new Adaptive Server operation with results pending [20019] (severity 7) [(null)] Expected result: ---------------- The SQL error is thrown by FreeTDS and it shouldn't throw it. Actual result: -------------- SQL error .. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=46262&edit=1