source: trunk/phpgwapi/inc/adodb/tests/pdo.php @ 2

Revision 2, 895 bytes checked in by niltonneto, 17 years ago (diff)

Removida todas as tags usadas pelo CVS ($Id, $Source).
Primeira versão no CVS externo.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2error_reporting(E_ALL);
3include('../adodb.inc.php');
4
5
6
7echo "New Connection\n";
8$DB = NewADOConnection('pdo');
9echo "Connect\n";
10$pdo_connection_string = 'odbc:nwind';
11$DB->Connect($pdo_connection_string,'','') || die("CONNECT FAILED");
12echo "Execute\n";
13
14
15
16//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
17$rs = $DB->Execute("select * from products where productid<3");
18echo "e=".$DB->ErrorNo() . " ".($DB->ErrorMsg())."\n";
19
20
21//print_r(get_class_methods($DB->_stmt));
22
23if (!$rs) die("NO RS");
24echo "FETCH\n";
25$cnt = 0;
26while (!$rs->EOF) {
27        print_r($rs->fields);
28        $rs->MoveNext();
29        if ($cnt++ > 1000) break;
30}
31
32echo "<br>--------------------------------------------------------<br>\n\n\n";
33
34$stmt = $DB->PrepareStmt("select * from products");
35$rs = $stmt->Execute();
36echo "e=".$stmt->ErrorNo() . " ".($stmt->ErrorMsg())."\n";
37while ($arr = $rs->FetchRow()) {
38        print_r($arr);
39}
40die("DONE\n");
41
42?>
Note: See TracBrowser for help on using the repository browser.