当前位置: 首页>>代码示例>>PHP>>正文


PHP rs2tabout函数代码示例

本文整理汇总了PHP中rs2tabout函数的典型用法代码示例。如果您正苦于以下问题:PHP rs2tabout函数的具体用法?PHP rs2tabout怎么用?PHP rs2tabout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了rs2tabout函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: NewADOConnection

    $db = NewADOConnection('access');
    $db->Connect('nwind');
}
if (empty($driver) or $driver == 'mysql') {
    $db = NewADOConnection('mysql');
    $db->Connect('localhost', 'root', '', 'test');
}
//$db->pageExecuteCountRows = false;
$db->debug = true;
if (0) {
    $rs = $db->Execute($sql);
    include_once '../toexport.inc.php';
    print "<pre>";
    print rs2csv($rs);
    # return a string
    print '<hr />';
    $rs->MoveFirst();
    # note, some databases do not support MoveFirst
    print rs2tab($rs);
    # return a string
    print '<hr />';
    $rs->MoveFirst();
    rs2tabout($rs);
    # send to stdout directly
    print "</pre>";
}
$pager = new ADODB_Pager($db, $sql);
$pager->showPageLinks = true;
$pager->linksPerPage = 10;
$pager->cache = 60;
$pager->Render($rows = 7);
开发者ID:JonsonChang,项目名称:mail_tracker,代码行数:31,代码来源:testpaging.php

示例2: testdb


//.........这里部分代码省略.........
            print "<br><b>ASSOC returned numeric field</b></p>";
            break;
        }
        $rs->MoveNext();
    }
    if ($cnt != 3) {
        print "<br><b>Count should be 3, instead it was {$cnt}</b></p>";
    }
    $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
    if ($db->sysDate) {
        $saved = $db->debug;
        $db->debug = 1;
        $rs = $db->Execute("select {$db->sysDate} from adoxyz where id=1");
        if (ADORecordSet::UnixDate(date('Y-m-d')) != $rs->UnixDate($rs->fields[0])) {
            print "<p><b>Invalid date {$rs->fields[0]}</b></p>";
        } else {
            print "<p>Passed \$sysDate test ({$rs->fields[0]})</p>";
        }
        print_r($rs->FetchField(0));
        print time();
        $db->debug = $saved;
    } else {
        print "<p><b>\$db->sysDate not defined</b></p>";
    }
    print "<p>Test CSV</p>";
    include_once '../toexport.inc.php';
    //$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
    $rs = $db->SelectLimit('select id,firstname,lastname,created,\'The	"young man", he said\' from adoxyz', 10);
    print "<pre>";
    print rs2csv($rs);
    print "</pre>";
    $rs = $db->SelectLimit('select id,firstname,lastname,created,\'The	"young man", he said\' from adoxyz', 10);
    print "<pre>";
    rs2tabout($rs);
    print "</pre>";
    //print " CacheFlush ";
    //$db->CacheFlush();
    $date = $db->SQLDate('d-m-Y-\\QQ');
    $sql = "SELECT {$date} from ADOXYZ";
    print "<p>Test SQLDate: " . htmlspecialchars($sql) . "</p>";
    $rs = $db->SelectLimit($sql, 1);
    $d = date('d-m-Y-') . 'Q' . ceil(date('m') / 3.0);
    if ($d != $rs->fields[0]) {
        Err("SQLDate failed expected: {$d}, sql:" . $rs->fields[0]);
    }
    print "<p>Test Filter</p>";
    $rs = $db->SelectLimit('select * from ADOXYZ where id < 3 order by id');
    $rs = RSFilter($rs, 'do_strtolower');
    if (trim($rs->fields[1]) != 'caroline' && trim($rs->fields[2]) != 'miranda') {
        err('**** RSFilter failed');
        print_r($rs->fields);
    }
    rs2html($rs);
    $db->debug = 1;
    print "<p>Test Replace</p>";
    $ret = $db->Replace('adoxyz', array('id' => 1, 'firstname' => 'Caroline', 'lastname' => 'Miranda'), array('id'), $autoq = true);
    if (!$ret) {
        echo "<p>Error in replacing existing record</p>";
    } else {
        $saved = $db->debug;
        $db->debug = 0;
        $savec = $ADODB_COUNTRECS;
        $ADODB_COUNTRECS = true;
        $rs = $db->Execute('select * FROM ADOXYZ where id=1');
        $db->debug = $saved;
        if ($rs->RecordCount() != 1) {
开发者ID:alexpagnoni,项目名称:adodb,代码行数:67,代码来源:test.php

示例3: testdb


//.........这里部分代码省略.........
            break;
        }
        $rs->MoveNext();
    }
    if ($cnt != 3) {
        print "<br><b>Count should be 3, instead it was {$cnt}</b></p>";
    }
    $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
    if ($db->sysDate) {
        $saved = $db->debug;
        $db->debug = 1;
        $rs = $db->Execute("select {$db->sysDate} from ADOXYZ where id=1");
        if (ADORecordSet::UnixDate(date('Y-m-d')) != $rs->UnixDate($rs->fields[0])) {
            print "<p><b>Invalid date {$rs->fields[0]}</b></p>";
        } else {
            print "<p>Passed \$sysDate test ({$rs->fields[0]})</p>";
        }
        print_r($rs->FetchField(0));
        print time();
        $db->debug = $saved;
    } else {
        print "<p><b>\$db->sysDate not defined</b></p>";
    }
    print "<p>Test CSV</p>";
    include_once '../toexport.inc.php';
    //$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
    $rs = $db->SelectLimit('select id,firstname,lastname,created,\'He, he\' he,\'"\' q  from ADOXYZ', 10);
    print "<pre>";
    print rs2csv($rs);
    print "</pre>";
    $rs = $db->SelectLimit('select id,firstname,lastname,created,\'The	"young man", he said\' from ADOXYZ', 10);
    if (PHP_VERSION < 5) {
        print "<pre>";
        rs2tabout($rs);
        print "</pre>";
    }
    #print " CacheFlush ";
    #$db->CacheFlush();
    $date = $db->SQLDate('d-m-M-Y-\\QQ h:i:s A');
    $sql = "SELECT {$date} from ADOXYZ";
    print "<p>Test SQLDate: " . htmlspecialchars($sql) . "</p>";
    $rs = $db->SelectLimit($sql, 1);
    $d = date('d-m-M-Y-') . 'Q' . ceil(date('m') / 3.0) . date(' h:i:s A');
    if (!$rs) {
        Err("SQLDate query returned no recordset");
    } else {
        if ($d != $rs->fields[0]) {
            Err("SQLDate 1 failed expected: <br>act:{$d} <br>sql:" . $rs->fields[0]);
        }
    }
    $date = $db->SQLDate('d-m-M-Y-\\QQ h:i:s A', $db->DBDate("1974-02-25"));
    $sql = "SELECT {$date} from ADOXYZ";
    print "<p>Test SQLDate: " . htmlspecialchars($sql) . "</p>";
    $db->debug = 1;
    $rs = $db->SelectLimit($sql, 1);
    $ts = ADOConnection::UnixDate('1974-02-25');
    $d = date('d-m-M-Y-', $ts) . 'Q' . ceil(date('m', $ts) / 3.0) . date(' h:i:s A', $ts);
    if (!$rs) {
        Err("SQLDate query returned no recordset");
        echo $db->ErrorMsg(), '<br>';
    } else {
        if ($d != reset($rs->fields)) {
            Err("SQLDate 2 failed expected: <br>act:{$d} <br>sql:" . $rs->fields[0] . ' <br>' . $db->ErrorMsg());
        }
    }
    print "<p>Test Filter</p>";
开发者ID:mvpphet,项目名称:IntranetPaper,代码行数:67,代码来源:test.php

示例4: strlen

						$message .= "<a href=\"./index.php?module=mod_csv&action=exportcsv&param=selectrow&db_table=".$_REQUEST["db_table"]."\">Retour</a>\n";
					}else{	
						$query = "SELECT ".substr($list, 0, strlen($list)-1)." FROM ".$_REQUEST["db_table"];	
				
						$resultat = &$connexion->Execute($query);
						
						if (!$resultat) 
							print $connexion->ErrorMsg();

						$file_name = "csv-".substr($_REQUEST["db_table"], strlen($GLOBALS["db_prefix"])+1).".csv";

						$download = new Download();
						$download->Now($file_name,"");
						
						$resultat->MoveFirst();
						rs2tabout($resultat); 
						exit;
					}
					break;
				
				case 'selectrow':
					// get the list of the row in the table
					$query = "SHOW FIELDS FROM ".$_REQUEST["db_table"];
					
					$resultat = &$connexion->Execute($query);
		
					if (!$resultat) 
						print $connexion->ErrorMsg();
						
						
					$select = "<div align=\"left\"><table border=\"0\">\n";
开发者ID:BackupTheBerlios,项目名称:eshop,代码行数:31,代码来源:mod_csv.php


注:本文中的rs2tabout函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。