• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there no longer a need for num_rows()?

#1
Looking at CI4 and working with databases I can't find a way to get the number of rows returned from a query. 
In CI3 I often did:
PHP Code:
/** @var CI_DB_result $query */
$query $this->db->get(TBL_INVITES);

if (
$query->num_rows() !== 1)
{
    return 
FALSE;
}

/** Continue processing **/ 

Should I do like this in CI4 or is there a better way?
PHP Code:
if (count($query->getResultArray()) !== 1)
{
    return 
false;

Reply


Messages In This Thread
Is there no longer a need for num_rows()? - by tgix - 08-11-2019, 11:04 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.