Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Single Row?
  • I was wondering if there's a function for returning a single result so I dont need to loop through the result set? like row() in codeigniter row()
    This function returns a single result row. If your query has more than one row, it returns only the first row. The result is returned as an object. Here's a usage example:
  • Hi, You can do it this way:
    $query = \DB::select( 'id', 'username', 'group', 'email' ) ->from( 'users' ) ->where('id', '=', 1234 ) ->execute() ->current();
    
    For more info, see: http://fuelphp.com/forums/topics/view/1136 Jozef
  • Jozef Kapicak wrote on Friday 6th of May 2011:
    Hi, You can do it this way:
    $query = \DB::select( 'id', 'username', 'group', 'email' ) ->from( 'users' ) ->where('id', '=', 1234 ) ->execute() ->current();
    
    For more info, see: http://fuelphp.com/forums/topics/view/1136 Jozef

    Awesome, thank you

Howdy, Stranger!

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

In this Discussion