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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2019 The PHP Group
All rights reserved.
Last updated: Tue Aug 20 11:01:28 2019 UTC