Bug #13131 Updated: Bad results with fbsql_num_rows

From: Date: Sun, 18 Nov 2001 13:35:57 +0000
Subject: Bug #13131 Updated: Bad results with fbsql_num_rows
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-70802@lists.php.net to get a copy of this message
ID: 13131 Updated by: mj Reported By: olivier.marie@ulysse.u-bordeaux.fr Old Status: Feedback Status: Closed Bug Type: FrontBase related Operating System: Sun OS PHP Version: 4.0.6 New Comment: No feedback -> Closing. Please reopen, if the problem persists. Previous Comments: ------------------------------------------------------------------------ [2001-11-03 13:17:35] 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-09-04 09:03:56] olivier.marie@ulysse.u-bordeaux.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); ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=13131&edit=1

« previous php.dev (#70802) next »