File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / sqlite3 / tests / sqlite3_prepared_stmt_clear_with_params.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:02 2012 UTC (12 years, 5 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--TEST--
SQLite3Stmt::clear test with parameters
--CREDITS--
Thijs Feryn <thijs@feryn.eu>
#TestFest PHPBelgium 2009
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
$db = new SQLite3(':memory:');
define('TIMENOW', time());
echo "Creating Table\n";
$db->exec('CREATE TABLE test (time INTEGER, id STRING)');
echo "INSERT into table\n";
var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')"));

echo "SELECTING results\n";
$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC");
var_dump($stmt->clear('invalid argument'));
echo "Closing database\n";
var_dump($db->close());
echo "Done\n";
?>
--EXPECTF--
Creating Table
INSERT into table
bool(true)
SELECTING results

Warning: SQLite3Stmt::clear() expects exactly 0 parameters, 1 given in %s on line %d
NULL
Closing database
bool(true)
Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>