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 test_pdo_sqlite_lastinsertid (id INT AUTO INCREMENT, name TEXT)'); 10$db->query('INSERT INTO test_pdo_sqlite_lastinsertid VALUES (NULL, "PHP"), (NULL, "PHP6")'); 11var_dump($db->query('SELECT * FROM test_pdo_sqlite_lastinsertid')); 12var_dump($db->errorInfo()); 13var_dump($db->lastInsertId()); 14 15?> 16--EXPECT-- 17object(PDOStatement)#2 (1) { 18 ["queryString"]=> 19 string(42) "SELECT * FROM test_pdo_sqlite_lastinsertid" 20} 21array(3) { 22 [0]=> 23 string(5) "00000" 24 [1]=> 25 NULL 26 [2]=> 27 NULL 28} 29string(1) "2" 30