3 V4.81 3 May 2006 (c) 2000-2011 John Lim (jlim#natsoft.com). 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.
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";
26 $db = NewADOConnection("oci8po");
28 $db->Connect('localhost','scott','natsoft','sherkhan');
32 $db = NewADOConnection("mysql");
33 $db->Connect('localhost','root','','northwind');
37 $db = NewADOConnection("mysqli://root:@localhost/northwind");
38 //$db->Connect('localhost','root','','test');
41 } catch (exception
$e){
42 echo "Connect Failed";
49 $cnt = $db->GetOne("select count(*) from adoxyz where ?<id and id<?",array(10,20));
50 $stmt = $db->Prepare("select * from adoxyz where ?<id and id<?");
51 if (!$stmt) echo $db->ErrorMsg(),"\n";
52 $rs = $db->Execute($stmt,array(10,20));
54 echo "<hr /> Foreach Iterator Test (rand=".rand().")<hr />";
58 echo "rec $i: "; $s1 = adodb_pr($v,true); $s2 = adodb_pr($rs->fields
,true);
59 if ($s1 != $s2 && !empty($v)) {adodb_pr($s1); adodb_pr($s2);}
60 else echo "passed<br>";
64 $rs = new ADORecordSet_empty();
66 echo "<p>empty ";var_dump($v);
70 if ($i != $cnt) die("actual cnt is $i, cnt should be $cnt\n");
71 else echo "Count $i is correct<br>";
73 $rs = $db->Execute("select bad from badder");
75 } catch (exception
$e) {
77 echo "<h3>adodb_backtrace:</h3>\n";
78 $e = adodb_backtrace($e->gettrace());
81 $rs = $db->Execute("select distinct id, firstname,lastname from adoxyz order by id");
82 echo "Result=\n",$rs,"</p>";
84 echo "<h3>Active Record</h3>";
86 include_once("../adodb-active-record.inc.php");
87 ADOdb_Active_Record
::SetDatabaseAdapter($db);
90 class City
extends ADOdb_Active_Record
{};
93 } catch(exception
$e){
94 echo $e->getMessage();
101 echo "<p>Successfully created City()<br>";
102 #var_dump($a->GetPrimaryKeys());
103 $a->city
= 'Kuala Lumpur';
106 #$a->SetPrimaryKeys(array('city'));
107 $a->country
= "M'sia";
110 } catch(exception
$e){
111 echo $e->getMessage();
114 //include_once("test-active-record.php");