2 error_reporting(E_ALL
);
3 include('../adodb.inc.php');
7 echo "New Connection\n";
10 $dsn = 'pdo_mysql://root:@localhost/northwind?persist';
13 $DB = NewADOConnection($dsn) ||
die("CONNECT FAILED");
17 $DB = NewADOConnection('pdo');
23 $connstr = 'odbc:nwind';
30 $connstr ="sqlite:d:\inetpub\adodb\sqlite.db";
33 $connstr = "mysql:dbname=northwind";
36 $connstr = "pgsql:dbname=test";
40 $DB->Connect($connstr,$u,$p) ||
die("CONNECT FAILED");
44 echo "connection string=$connstr\n Execute\n";
46 //$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
47 $rs = $DB->Execute("select * from ADOXYZ where id<3");
48 if ($DB->ErrorNo()) echo "*** errno=".$DB->ErrorNo() . " ".($DB->ErrorMsg())."\n";
51 //print_r(get_class_methods($DB->_stmt));
53 if (!$rs) die("NO RS");
56 for ($i=0; $i < $rs->NumCols(); $i++
) {
57 var_dump($rs->FetchField($i));
64 adodb_pr($rs->fields
);
66 if ($cnt++
> 1000) break;
69 echo "<br>--------------------------------------------------------<br>\n\n\n";
71 $stmt = $DB->PrepareStmt("select * from ADOXYZ");
73 $rs = $stmt->Execute();
74 $cols = $stmt->NumCols(); // execute required
77 for($i=1;$i<=$cols;$i++
) {
78 $v = $stmt->_stmt
->getColumnMeta($i);
82 echo "e=".$stmt->ErrorNo() . " ".($stmt->ErrorMsg())."\n";
83 while ($arr = $rs->FetchRow()) {
88 } catch (exception
$e) {