j4mie / idiorm

A lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP5.
http://j4mie.github.com/idiormandparis/
2.01k stars 369 forks source link

lastInsertId not supported for ODBC #266

Closed WoLfulus closed 9 years ago

WoLfulus commented 9 years ago

I'm using ODBC to connect to a SQL Server instance and PDO::lastInsertId() is not supported. For several reasons I cannot use sqlsrv or dblib. What would be the proper way to implement the different lastInsertId() inside idiorm?

Thanks!

treffynnon commented 9 years ago

Doubt that the PDO driver for ODBC supports lastInsertId which would make this outside of the realms of Idiorms control.

http://stackoverflow.com/questions/781677/php-get-the-last-insert-id-from-odbc-connection might have a solution for you.

WoLfulus commented 9 years ago

well, yeah, I had the solution already, maybe it wasn't clear on the question, but I just wanted to know how to do the "proper" integration into Idiorm to get the last id for ODBC (with custom configs maybe?).

Anyways, thanks.