2 error_reporting(E_ALL);
3 include('../adodb.inc.php');
5 include('../adodb-active-record.inc.php');
7 ###########################
9 $ADODB_ACTIVE_CACHESECS = 36;
14 if ($DBMS == 'mysql') {
15 $db = NewADOConnection('mysql://root@localhost/northwind');
16 } else if ($DBMS == 'postgres') {
17 $db = NewADOConnection('postgres');
18 $db->Connect("localhost","tester","test","test");
20 $db = NewADOConnection('oci8://scott:natsoft@/');
23 $arr = $db->ServerInfo();
24 echo "<h3>$db->dataProvider: {$arr['description']}</h3>";
26 $arr = $db->GetActiveRecords('products',' productid<10');
29 ADOdb_Active_Record::SetDatabaseAdapter($db);
30 if (!$db) die('failed');
35 $rec = new ADODB_Active_Record('photos');
37 $rec = new ADODB_Active_Record('products');
40 adodb_pr($rec->getAttributeNames());
45 $rec->load('productid=2');
51 $rec->productname = 'Changie Chan'.rand();
56 $rec->productname = 'Changie Chan 99';
60 $rec2 = new ADODB_Active_Record('products');
61 $rec->load('productid=3');
64 $rec = new ADODB_Active_record('products');
65 $rec->productname = 'John ActiveRec';
76 echo "<p>Affected Rows after delete=".$db->Affected_Rows()."</p>";