Annotation of embedaddon/php/ext/sqlite3/tests/sqlite3_14_querysingle.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SQLite3::querySingle 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->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')"));
! 17:
! 18: echo "SELECTING results\n";
! 19: var_dump($db->querySingle("SELECT id FROM test WHERE id = 'a'"));
! 20: var_dump($db->querySingle("SELECT id, time FROM test WHERE id = 'a'", true));
! 21:
! 22: echo "Done"
! 23: ?>
! 24: --EXPECTF--
! 25: Creating Table
! 26: bool(true)
! 27: INSERT into table
! 28: bool(true)
! 29: bool(true)
! 30: SELECTING results
! 31: string(1) "a"
! 32: array(2) {
! 33: ["id"]=>
! 34: string(1) "a"
! 35: ["time"]=>
! 36: int(%d)
! 37: }
! 38: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>