php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13131 Bad results with fbsql_num_rows
Submitted: 2001-09-04 09:03 UTC Modified: 2001-11-18 08:35 UTC
From: olivier dot marie at ulysse dot u-bordeaux dot fr Assigned:
Status: Closed Package: FrontBase related
PHP Version: 4.0.6 OS: Sun OS
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: olivier dot marie at ulysse dot u-bordeaux dot fr
New email:
PHP Version: OS:

 

 [2001-09-04 09:03 UTC] olivier dot marie at ulysse dot u-bordeaux dot fr
The number of rows returned by fbsql_num_rows is wrong when used with 'select DISTINCT' query. This script shows differences between fbsql_num_rows function and a while over all rows. This problem doesn't appear if you don't use the 'distinct' option.
Greetings
-----------------------------------------------------------

$conn=fbsql_connect("127.0.0.1","myname","mypassword");
fbsql_select_db("mybase",$conn)	;
$sql = "select distinct id_actor from actor_table;";
$result=fbsql_query($sql,$conn) ;

$num_rows = fbsql_num_rows($result); 
echo "$num_rows Rows\n";// displays "2147483647 Rows"

$i=0;
while ($row=fbsql_fetch_array($result)) 
	$i++;
echo "$i Rows\n";	// displays "5 Rows"

@fbsql_free_result($result);
@fbsql_close($conn);

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-03 13:17 UTC] mj@php.net
Please try the latest version of PHP from CVS or the latest snapshot from http://snaps.php.net/. There was a patch regarding your problem a few days ago.
 [2001-11-18 08:35 UTC] mj@php.net
No feedback -> Closing. 

Please reopen, if the problem persists.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 18:01:29 2024 UTC