ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/WEBCONDDB/php_CondDB/adodb/tests/testpear.php
Revision: 1.1
Committed: Fri Jun 29 07:49:41 2007 UTC (17 years, 10 months ago) by kdziedzi
Branch: MAIN
CVS Tags: V01-01-02, V01-01-01, V1_01_00, V01-01-00, V1_00_01, HEAD
Log Message:
Introducing new order in project

File Contents

# User Rev Content
1 kdziedzi 1.1 <?php
2     /*
3     V4.80 8 Mar 2006 (c) 2000-2006 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 4 for best viewing.
8    
9     Latest version is available at http://adodb.sourceforge.net
10     */
11    
12     error_reporting(E_ALL);
13    
14     include_once('../adodb-pear.inc.php');
15     $username = 'root';
16     $password = '';
17     $hostname = 'localhost';
18     $databasename = 'xphplens';
19     $driver = 'mysql';
20    
21     $dsn = "$driver://$username:$password@$hostname/$databasename";
22    
23     $db = DB::Connect($dsn);
24     $db->setFetchMode(ADODB_FETCH_ASSOC);
25     $rs = $db->Query('select firstname,lastname from adoxyz');
26     $cnt = 0;
27     while ($arr = $rs->FetchRow()) {
28     print_r($arr);
29     print "<br>";
30     $cnt += 1;
31     }
32    
33     if ($cnt != 50) print "<b>Error in \$cnt = $cnt</b>";
34     ?>