Welcome Guest, Not a member yet? Register   Sign In
num_rows returning empty while result_array has results
#10

When I said "caching", I didn't mean it in any of the ways that you're all discussing right now.

Caching just means to save something locally, so you don't have to fetch it from somewhere else when you need it again. In that sense, when you call num_rows() method once, CI will store/cache the appropriate value in a $num_rows property so that it doesn't need to get it from the underlying low-level APIs if you call num_rows() again. This is because some PHP database extensions only allow us to get the number of rows once, or don't support such method at all and we need to fetch all the results first and do a count() on them instead.

Just use what the documentation says and don't worry about this stuff.
Reply


Messages In This Thread
RE: num_rows returning empty while result_array has results - by Narf - 03-27-2015, 03:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB