File: 21freeResult.phpt

package info (click to toggle)
php-db 1.12.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,040 kB
  • sloc: php: 7,407; pascal: 1,002; xml: 205; sh: 22; makefile: 8
file content (28 lines) | stat: -rwxr-xr-x 522 bytes parent folder | download | duplicates (4)
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
--TEST--
DB_driver::freeResult
--SKIPIF--
<?php
require_once dirname(__FILE__) . '/skipif.inc';
?>
--FILE--
<?php
require_once dirname(__FILE__) . '/mktable.inc';

$res = $dbh->query('SELECT * FROM phptest');

if (DB::isError($res)) {
    echo "Result is a DB_Error.\n";
    drop_table($dbh, 'phptest');
    exit;
}

if ($dbh->freeResult($res->result)) {
    echo "Result was freed successfully.\n";
} else {
    echo "Error freeing result.\n";
}

drop_table($dbh, 'phptest');
?>
--EXPECT--
Result was freed successfully.