FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » unbuffered resultsets: "mysqli_num_rows() will not return the correct number of rows.." ?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
unbuffered resultsets: "mysqli_num_rows() will not return the correct number of rows.." ? [message #171063] Mon, 20 December 2010 15:37
David is currently offline  David
Messages: 2
Registered: December 2010
Karma: 0
Junior Member
Apologies if this is a stupid question, but what does the following somewhat
stern warning in the mysqli_result->num_rows manual page actually mean in
practice?

"The use of mysqli_num_rows() depends on whether you use buffered or
unbuffered result sets. In case you use unbuffered resultsets
mysqli_num_rows() will not return the correct number of rows until all the
rows in the result have been retrieved."

-- http://www.php.net/manual/en/mysqli-result.num-rows.php


I don't knowingly use buffered resultsets (PHP output comes out unbuffered
unless explicitly specified otherwise, doesn't it?), so I'm a little
concerned that the above warning might affect me?

At which point have "all [of] the rows in the result [..] been retrieved"?

Is it when you you make your query, eg:

$result = mysqli_query($db, $query);

or does that only create storage _for_ the result but not actually populate
it at that point, requiring later code such as the following to populate the
resultset(?), eg:

while ($row = mysqli_fetch_array($result)) {
// Stuff things into variables..
}


Thanks for any clarification anyone can offer,


David.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: UK developers wanted for online academic research survey
Next Topic: Good book about OOP in PHP?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 17:57:37 GMT 2024

Total time taken to generate the page: 0.02506 seconds