Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Last insert id
  • HI All, Instead of this method,
    list($insert_id, $rows_affected) = DB::insert('users')->set(array(
        'name' => 'John Random',
        'email' => 'john@example.com',
        'password' => 's0_s3cr3t',
    ))->execute();
    

    is there a way something like this to grab the last id? DB::insert_id();
  • It's stored as a property of the connection, but it's a protected property and as far as I can see no method to retrieve it. You can create an issue for this on https://github.com/fuel/core/issues so someone can have a look at it.

Howdy, Stranger!

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

In this Discussion