Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Database results
  • I'm wondering if there is a simple way to fetch just a single row or value from a database query. I'm ending up with code that looks like this, and it looks like kind of a mess: $result = DB::select()->from('users')->where('email', $email)->execute();
    $result = $result->as_array();
    $row = $result[0]; Not to mention error checking, Seems like it could be taken care of simply with something like this: $row = DB::select()->from('users')->where('email', $email)->execute()->row(); or $value = DB::select('user_id')->from('users')->where('email', $email)->execute()->value(); Is there already a way to do this? Thanks,
    Brad
  • Perfect, 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