Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Help! PDO MSSQL - lastInsertId Error
  • Hi, When connected to MSSQL using PDO and executing a simple insert query I get this error: <code>PDOException [ IM001 ]: SQLSTATE[IM001]: Driver does not support this function: driver does not support lastInsertId()</code> <code>COREPATH/classes/database/pdo/connection.php @ line 178</code> I have found a tmp fix (psudeo), but im not sure how or where to implement this? <code> public function lastInsertId() {
    if (dbms == 'mssql') {
    $res = query('SELECT SCOPE_IDENTITY() as last_id');
    return last_id;
    } return parent::lastInsertId();
    }
    </code>
  • The query builder currently only supports MySQL completely. The PDO driver is a generic driver, that doesn't know the MSSQL specifics. I'm working on a improved QB in the feature/sqlbuilder branch, which currently has a MSSQL specific PDO driver which already supports limit() and offset(). I'll add this to the todo list for that driver.
  • thanks wiz. any idea on a timeframe?
  • No. Focus is on getting v1.0 out the door as soon as possible. The new QB requires API changes, so it would be part of 1.0.

Howdy, Stranger!

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

In this Discussion