1--TEST-- 2PDO_sqlite: Testing lastInsertId() 3--SKIPIF-- 4<?php if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; ?> 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--EXPECTF-- 20object(PDOStatement)#2 (1) { 21 ["queryString"]=> 22 %string|unicode%(17) "SELECT * FROM foo" 23} 24array(3) { 25 [0]=> 26 %string|unicode%(5) "00000" 27 [1]=> 28 NULL 29 [2]=> 30 NULL 31} 32%string|unicode%(1) "2" 33