php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26590 mssql_num_rows()
Submitted: 2003-12-11 00:04 UTC Modified: 2003-12-11 06:33 UTC
From: bhavin dot shah at cgi dot com Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 4.3.4 OS: Windows
Private report: No CVE-ID: None
 [2003-12-11 00:04 UTC] bhavin dot shah at cgi dot com
Description:
------------
As per the documentation, mssql_num_rows() returns the number of rows in a result set. It works fine, if stored procedure returns some records. But it gives following error when stored procedure returns nothing (empty recordset). 

mssql_num_rows(): supplied argument is not a valid MS SQL-result resource

mssql_num_rows() should return 0, when no records are returned from stored procedure.


It seems that the problem is with mssql_execute(). It does not return any Resource ID, if the result is empty. Hence, mysql_num_rows() fails which expects Resource ID as the parameter.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-11 06:33 UTC] sniper@php.net
You need to check that passed parameters are valid.
No bug here.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 03:01:27 2024 UTC