|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-11-03 13:17 UTC] mj@php.net
[2001-11-18 08:35 UTC] mj@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 08:00:01 2025 UTC |
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);