summaryrefslogtreecommitdiff
path: root/ext/sqlite3/tests/bug45798.phpt
blob: 9637c1fc9baa89196874431dc9089600c5983dc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--TEST--
Bug #45798 (sqlite3 doesn't notice if variable was bound)
--SKIPIF--
<?php require_once(__DIR__ . '/skipif.inc'); ?>
--FILE--
<?php

require_once(__DIR__ . '/new_db.inc');

$db->exec('CREATE TABLE test (time INTEGER, id STRING)');

$db->exec("INSERT INTO test (time, id) VALUES (" . time() . ", 'a')");
$db->exec("INSERT INTO test (time, id) VALUES (" . time() . ", 'b')");

$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC");

$stmt->bindParam(1, $foo, SQLITE3_TEXT);
$results = $stmt->execute();

while ($result = $results->fetchArray(SQLITE3_NUM)) {
	var_dump($result);
}

$results->finalize();

$db->close();

print "done";

?>
--EXPECT--
done