I’m a FuelPHP newbie and I have a query problem. So, this is my code:
$query = DB::query('SELECT * FROM `table`');
$result = $query->execute();
$totals = $result->_total_rows;
print_r($totals);
And i keep getting following error:
Fatal error: Cannot access protected property Fuel\Core\Database_MySQL_Result::$_total_rows
If you want the number of rows returned by a query simply
Referenced here in the manual
Or in your case, as you’re selecting all from a table and counting it, you could use the following instead
Referenced here in the manual