Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
How do you access the total_rows returned from a DB::select statement
  • This is probably a dumb question but I have something like
    $result = DB::select('id')
    ->from('posts')
    ->where('user_id',$id)
    ->execute();
    
    

    and when I dump $result I get the query object with the protected property of total_rows, how do I get that number?
  • I think you can do count($result), or (if it's an object) echo $result->count()

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion