1--TEST--
2Test sqlite_exec() function : basic functionality
3--SKIPIF--
4<?php if (!extension_loaded("sqlite")) print "skip sqlite extension not loaded"; ?>
5--FILE--
6<?php
7/* Prototype  : boolean sqlite_exec(string query, resource db[, string &error_message])
8 * Description: Executes a result-less query against a given database
9 * Source code: ext/sqlite/sqlite.c
10 * Alias to functions:
11 */
12
13echo "*** Testing sqlite_exec() : basic functionality ***\n";
14
15// set up variables
16$query = 'CREATE TABLE foobar (id INTEGER PRIMARY KEY, name CHAR(255));';
17$error_message = null;
18
19// procedural
20$db = sqlite_open(':memory:');
21var_dump( sqlite_exec($db, $query) );
22sqlite_close($db);
23
24// oo-style
25$db = new SQLiteDatabase(':memory:');
26var_dump( $db->queryExec($query, $error_message) );
27
28?>
29===DONE===
30--EXPECTF--
31*** Testing sqlite_exec() : basic functionality ***
32bool(true)
33bool(true)
34===DONE===
35