1--TEST-- 2PDO_sqlite: Testing lastInsertId() 3--EXTENSIONS-- 4pdo_sqlite 5--FILE-- 6<?php 7 8$db = new PDO('sqlite::memory:'); 9$db->query('CREATE TABLE IF NOT EXISTS foo (id INT AUTO INCREMENT, name TEXT)'); 10$db->query('INSERT INTO foo VALUES (NULL, "PHP")'); 11$db->query('INSERT INTO foo VALUES (NULL, "PHP6")'); 12var_dump($db->query('SELECT * FROM foo')); 13var_dump($db->errorInfo()); 14var_dump($db->lastInsertId()); 15 16$db->query('DROP TABLE foo'); 17 18?> 19--EXPECT-- 20object(PDOStatement)#2 (1) { 21 ["queryString"]=> 22 string(17) "SELECT * FROM foo" 23} 24array(3) { 25 [0]=> 26 string(5) "00000" 27 [1]=> 28 NULL 29 [2]=> 30 NULL 31} 32string(1) "2" 33