stop reporting of a custom error (it is benign) to the php logfile
[openemr.git] / library / adodb / tests / test-php5.php
blobc735aa7386546ad8f76f0e33f3c117d969907335
1 <?php
2 /*
3 V4.20 22 Feb 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
4 Released under both BSD license and Lesser GPL library license.
5 Whenever there is any discrepancy between the two licenses,
6 the BSD license will take precedence.
7 Set tabs to 8.
8 */
11 error_reporting(E_ALL);
13 $path = dirname(__FILE__);
15 include("$path/../adodb-exceptions.inc.php");
16 include("$path/../adodb.inc.php");
18 echo "<h3>PHP ".PHP_VERSION."</h3>\n";
19 try {
21 $dbt = 'oci8';
23 switch($dbt) {
24 case 'oci8':
25 $db = NewADOConnection("oci8");
26 $db->Connect('','scott','natsoft');
27 break;
28 default:
29 case 'mysql':
30 $db = NewADOConnection("mysql");
31 $db->Connect('localhost','root','','test');
32 break;
35 $db->debug=1;
37 $cnt = $db->GetOne("select count(*) from adoxyz");
38 $rs = $db->Execute("select * from adoxyz order by id");
40 $i = 0;
41 foreach($rs as $v) {
42 $i += 1;
43 echo "$i: "; adodb_pr($v); adodb_pr($rs->fields);
44 flush();
47 if ($i != $cnt) die("actual cnt is $i, cnt should be $cnt\n");
50 $rs = $db->Execute("select bad from badder");
52 } catch (exception $e) {
53 adodb_pr($e);
54 echo "<h3>adodb_backtrace:</h3>\n";
55 $e = adodb_backtrace($e->gettrace());