(09-15-2018, 12:24 PM)Paradinight Wrote: (09-15-2018, 10:51 AM)skunkbad Wrote: In CodeIgniter 3 we could run a query then find if there were rows returned: PHP Code:$q = $this->db->query('SELECT * FROM foo LIMIT 1');if( $q->num_rows() == 1 ) $row = $q->row(); In CI4 I don't see a way to check the number of rows, or if there was a row at all. How are you handling this? Can we get a numRows() please? Try $q->numRows
(09-15-2018, 10:51 AM)skunkbad Wrote: In CodeIgniter 3 we could run a query then find if there were rows returned: PHP Code:$q = $this->db->query('SELECT * FROM foo LIMIT 1');if( $q->num_rows() == 1 ) $row = $q->row(); In CI4 I don't see a way to check the number of rows, or if there was a row at all. How are you handling this? Can we get a numRows() please?
$q = $this->db->query('SELECT * FROM foo LIMIT 1');if( $q->num_rows() == 1 ) $row = $q->row();