PDO lastInsertId() always return 0
问题 I've come across with a problem. My framework was working just fine with PHP 5.3.0. I upgraded my PHP version to PHP 5.4.x and I started to have few issues with some parts of my framework. After PHP version upgrade, PDO lastInsterId() always returns 0 . I have auto-increment field called id . It is adding the data to database without any problems. For some reason I keep getting 0 as last insert id. Here is my code; databaseobjects.php public static function create () { global $db; $attributes