|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-12-22 14:14 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 17 08:00:01 2025 UTC |
Description: ------------ mssql_query() returns false despite a query being successfully executed if it's a query returning empty (or none) result sets (queries like INSERT or BEGIN TRANSACTION) Concerning my exmaple blelow: In the second two queries (where mssql_query falsly returned false), mssql_get_last_message() is empty. Looking at the MS-SQL-Server I could confirm that the queries where executed correctly (the ones in the example do nothing, but even when INSERTing something, I'm getting the same results). I'm quite positive that this working in PHP 5.0.2 and below. As this is quite a simple testcase and always reproducible, I'm pretty confident to have actually hit a bug here. Versions: php-5.3.0 (--with-mssql) freetds-0.62.3 (mssql support compiled in) Looking more thorugh the bug tracker, I came across #31195 which is the same thing for PHP 4.3. I can definitely confirm this happening with PHP5. Thanks for listening... Philip Reproduce code: --------------- <? $link = mssql_connect('srv', 'user', 'pass'); mssql_select_db('db', $link); $r = mssql_query('select something', $link); if ($r === false){ echo "1st query failed\n"; }else{ echo "1st query succeeded\n"; } $r = mssql_query('begin transaction', $link); if ($r === false){ echo "2nd query failed\n"; }else{ echo "2nd query succeeded\n"; } $r = mssql_query('rollback', $link); if ($r === false){ echo "3rd query failed\n"; }else{ echo "3rd query succeeded\n"; } ?> Expected result: ---------------- 1st query succeeded 2nd query succeeded 3rd query succeeded Actual result: -------------- 1st query succeeded 2nd query failed 3rd query failed