Welcome Guest, Not a member yet? Register   Sign In
DB doesn't have num_rows/numRows ??
#3

(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() == )

 
   $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

I will try it once I actually install CI4. I just didn't see anything in the documentation, so thought I'd ask.
Reply


Messages In This Thread
DB doesn't have num_rows/numRows ?? - by skunkbad - 09-15-2018, 10:51 AM
RE: DB doesn't have num_rows/numRows ?? - by skunkbad - 09-15-2018, 02:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB