CodeIgniter Forums
DB doesn't have num_rows/numRows ?? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: DB doesn't have num_rows/numRows ?? (/showthread.php?tid=71713)

Pages: 1 2


RE: DB doesn't have num_rows/numRows ?? - ojmichael - 12-28-2020

Why are you replying to every thread about this?

Why do you think performing a count() operation on the results array would be "wasting" CPU power but using mysql_num_rows or equivalent functions is free?


RE: DB doesn't have num_rows/numRows ?? - sneakyimp - 12-29-2020

(12-28-2020, 09:30 PM)ojmichael Wrote: Why are you replying to every thread about this?
I'm sorry if it bothers you that I've responded to numerous threads. I had done a search of the forum and was hoping that one of the folks who were looking for this functionality might agree that it'd be useful to have the functionality.

(12-28-2020, 09:30 PM)ojmichael Wrote: Why do you think performing a count() operation on the results array would be "wasting" CPU power but using mysql_num_rows or equivalent functions is free?
I mentioned in this other thread that I searched the PHP source code for the MySQLi extension and it looks like the code just checks an integer value in memory rather than 1) creating data structures for a new string for the count query, 2) overwriting various Builder values set by a prior query, 3) sending this string to a DBMS (which might be running on an entirely different machine), 4) collecting, parsing, and buffering the result from the separate DBMS process.


RE: DB doesn't have num_rows/numRows ?? - includebeer - 12-29-2020

(12-29-2020, 03:34 PM)sneakyimp Wrote:
(12-28-2020, 09:30 PM)ojmichael Wrote: Why are you replying to every thread about this?
I'm sorry if it bothers you that I've responded to numerous threads. I had done a search of the forum and was hoping that one of the folks who were looking for this functionality might agree that it'd be useful to have the functionality.

You bothered a lot of people by replying to 2 years old threads. Please, start your own thread instead of hijacking very old threads like that!


RE: DB doesn't have num_rows/numRows ?? - sneakyimp - 12-30-2020

(12-29-2020, 06:22 PM)includebeer Wrote: You bothered a lot of people by replying to 2 years old threads. Please, start your own thread instead of hijacking very old threads like that!
I apologize unreservedly. I was trying to avoid duplicate questions and hoping to interest folks with a prior interest in the topic. I will make my own post.