Annotation of embedaddon/php/ext/sqlite3/tests/sqlite3_24_last_insert_rowid.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SQLite3::lastInsertRowID tests
! 3: --SKIPIF--
! 4: <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: require_once(dirname(__FILE__) . '/new_db.inc');
! 9: define('TIMENOW', time());
! 10:
! 11: echo "Creating Table\n";
! 12: var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)'));
! 13:
! 14: echo "INSERT into table\n";
! 15: var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')"));
! 16: var_dump($db->lastInsertRowID());
! 17: var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')"));
! 18: var_dump($db->lastInsertRowID());
! 19:
! 20: echo "Closing database\n";
! 21: var_dump($db->close());
! 22: echo "Done\n";
! 23: ?>
! 24: --EXPECTF--
! 25: Creating Table
! 26: bool(true)
! 27: INSERT into table
! 28: bool(true)
! 29: int(1)
! 30: bool(true)
! 31: int(2)
! 32: Closing database
! 33: bool(true)
! 34: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>