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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
18 + 36 = ?
Subscribe to this entry?

 
 [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: Thu May 02 11:01:31 2024 UTC