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:
Should I do like this in CI4 or is there a better way?
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;
}