當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ADORecordSet類代碼示例

本文整理匯總了PHP中ADORecordSet的典型用法代碼示例。如果您正苦於以下問題:PHP ADORecordSet類的具體用法?PHP ADORecordSet怎麽用?PHP ADORecordSet使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ADORecordSet類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: DBTimeStamp

 function DBTimeStamp($ts)
 {
     if (is_string($ts)) {
         $d = ADORecordSet::UnixTimeStamp($ts);
     }
     return 'TO_DATE(' . date($this->fmtTimeStamp, $ts) . ",'RRRR-MM-DD, HH:MI:SS AM')";
 }
開發者ID:OberjukhtinIA0VWV0Allokuum,項目名稱:testmasteke.leo,代碼行數:7,代碼來源:adodb-oracle.inc.php

示例2: DBTimeStamp

	function DBTimeStamp($ts)
	{

		if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
		if (is_object($ts)) $ds = $ts->format($this->fmtDate);
		else $ds = adodb_date($this->fmtTimeStamp,$ts);
		return 'TO_DATE('.$ds.",'RRRR-MM-DD, HH:MI:SS AM')";
	}
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:8,代碼來源:adodb-oracle.inc.php

示例3: DBTimeStamp

 function DBTimeStamp($ts)
 {
     if (empty($ts) && $ts !== 0) {
         return 'null';
     }
     if (is_string($ts)) {
         $ts = ADORecordSet::UnixTimeStamp($ts);
     }
     return 'TO_DATE(' . date($this->fmtTimeStamp, $ts) . ",'RRRR-MM-DD, HH:MI:SS AM')";
 }
開發者ID:qoire,項目名稱:portal,代碼行數:10,代碼來源:adodb-oci8.inc.php

示例4: _getObjectsFromResult

 /**
  * @param ADORecordSet $rs
  * @return Model_WebapiKey[]
  */
 private static function _getObjectsFromResult($rs)
 {
     $objects = array();
     while (!$rs->EOF) {
         $object = new Model_WebapiKey();
         $object->id = intval($rs->fields['id']);
         $object->nickname = $rs->fields['nickname'];
         $object->access_key = $rs->fields['access_key'];
         $object->secret_key = $rs->fields['secret_key'];
         $rights = $rs->fields['rights'];
         if (!empty($rights)) {
             @($object->rights = unserialize($rights));
         }
         $objects[$object->id] = $object;
         $rs->MoveNext();
     }
     return $objects;
 }
開發者ID:sluther,項目名稱:portsensor,代碼行數:22,代碼來源:Rest.php

示例5:

 function &GetRowAssoc($upper = true)
 {
     if ($this->fetchMode == PGSQL_ASSOC && !$upper) {
         return $this->fields;
     }
     $row =& ADORecordSet::GetRowAssoc($upper);
     return $row;
 }
開發者ID:dasatti,項目名稱:dashboard,代碼行數:8,代碼來源:adodb-postgres64.inc.php

示例6: GetRowAssoc

 function GetRowAssoc($upper = true)
 {
     if ($this->fetchMode == MYSQL_ASSOC && !$upper) {
         $row = $this->fields;
     } else {
         $row = ADORecordSet::GetRowAssoc($upper);
     }
     return $row;
 }
開發者ID:JonsonChang,項目名稱:mail_tracker,代碼行數:9,代碼來源:adodb-mysql.inc.php

示例7: db_fetch_array

/**
 * Retrieve the next row returned from a specific database query
 * @param bool|ADORecordSet $p_result Database Query Record Set to retrieve next result for.
 * @return array Database result
 */
function db_fetch_array(&$p_result)
{
    global $g_db, $g_db_type;
    if ($p_result->EOF) {
        return false;
    }
    # mysql obeys FETCH_MODE_BOTH, hence ->fields works, other drivers do not support this
    if ($g_db_type == 'mysql' || $g_db_type == 'odbc_mssql' || $g_db_type == 'mssqlnative') {
        $t_array = $p_result->fields;
        $p_result->MoveNext();
        return $t_array;
    } else {
        $t_row = $p_result->GetRowAssoc(false);
        static $t_array_result;
        static $t_array_fields;
        if ($t_array_result != $p_result) {
            // new query
            $t_array_result = $p_result;
            $t_array_fields = null;
        } else {
            if ($t_array_fields === null) {
                $p_result->MoveNext();
                return $t_row;
            }
        }
        $t_convert = false;
        $t_fieldcount = $p_result->FieldCount();
        for ($i = 0; $i < $t_fieldcount; $i++) {
            if (isset($t_array_fields[$i])) {
                $t_field = $t_array_fields[$i];
            } else {
                $t_field = $p_result->FetchField($i);
                $t_array_fields[$i] = $t_field;
            }
            switch ($t_field->type) {
                case 'bool':
                    switch ($t_row[$t_field->name]) {
                        case 'f':
                            $t_row[$t_field->name] = false;
                            break;
                        case 't':
                            $t_row[$t_field->name] = true;
                            break;
                    }
                    $t_convert = true;
                    break;
                default:
                    break;
            }
        }
        if ($t_convert == false) {
            $t_array_fields = null;
        }
        $p_result->MoveNext();
        return $t_row;
    }
}
開發者ID:Tarendai,項目名稱:spring-website,代碼行數:62,代碼來源:database_api.php

示例8: _getObjectsFromResult

 /**
  * @param ADORecordSet $rs
  * @return Model_WatcherMailFilter[]
  */
 private static function _getObjectsFromResult($rs)
 {
     $objects = array();
     while (!$rs->EOF) {
         $object = new Model_WatcherMailFilter();
         $object->id = $rs->fields['id'];
         $object->pos = $rs->fields['pos'];
         $object->name = $rs->fields['name'];
         $object->created = $rs->fields['created'];
         $object->is_disabled = intval($rs->fields['is_disabled']);
         $object->worker_id = intval($rs->fields['worker_id']);
         if (null != @($criteria_ser = $rs->fields['criteria_ser'])) {
             if (false === @($object->criteria = unserialize($criteria_ser))) {
                 $object->criteria = array();
             }
         }
         if (null != @($actions_ser = $rs->fields['actions_ser'])) {
             if (false === ($object->actions = unserialize($actions_ser))) {
                 $object->actions = array();
             }
         }
         $objects[$object->id] = $object;
         $rs->MoveNext();
     }
     return $objects;
 }
開發者ID:Hildy,項目名稱:cerb5,代碼行數:30,代碼來源:App.php

示例9: _getObjectsFromResultSet

 private static function _getObjectsFromResultSet(ADORecordSet $rs)
 {
     $objects = array();
     while (!$rs->EOF) {
         $tag = new CloudGlueTag();
         $tag->id = intval($rs->fields['id']);
         $tag->name = $rs->fields['name'];
         $objects[$tag->id] = $tag;
         $rs->MoveNext();
     }
     return $objects;
 }
開發者ID:sluther,項目名稱:portsensor,代碼行數:12,代碼來源:DAO.php

示例10: GetRowAssoc

 public function GetRowAssoc($upper = true)
 {
     if ($this->fetchMode == MYSQLI_ASSOC && !$upper) {
         return $this->fields;
     }
     $row = ADORecordSet::GetRowAssoc($upper);
     return $row;
 }
開發者ID:bermi,項目名稱:akelos,代碼行數:8,代碼來源:adodb-mysqli.inc.php

示例11: DBTimeStamp

 function DBTimeStamp($ts)
 {
     if (empty($ts) && $ts !== 0) {
         return 'null';
     }
     if (is_string($ts)) {
         $ts = ADORecordSet::UnixTimeStamp($ts);
     }
     // See #8387 for more details
     // original: return 'TO_DATE('.adodb_date($this->fmtTimeStamp,$ts).",'YYYY-MM-DD HH24:MI:SS')";
     return adodb_date($this->fmtTimeStamp, $ts);
 }
開發者ID:jin255ff,項目名稱:company_website,代碼行數:12,代碼來源:adodb-db2.inc.php

示例12: testdb


//.........這裏部分代碼省略.........
            $fld = $rs->FetchField($i);
            print "<br> Field name is " . $fld->name;
            print " " . $rs->Fields($fld->name);
        }
    }
    print "<p>NUM TEST 2<br>";
    $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
    $rs = $db->query('select * from adoxyz order by id');
    for ($i = 0; $i < $rs->FieldCount(); $i++) {
        $fld = $rs->FetchField($i);
        print "<br> Field name is " . $fld->name;
        print " " . $rs->Fields($fld->name);
    }
    print "<p>ASSOC Test of SelectLimit<br>";
    $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
    $rs = $db->selectlimit('select * from adoxyz order by id', 3, 4);
    $cnt = 0;
    while ($rs && !$rs->EOF) {
        $cnt += 1;
        if (!isset($rs->fields['firstname'])) {
            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>";
開發者ID:alexpagnoni,項目名稱:adodb,代碼行數:67,代碼來源:test.php

示例13: testdb


//.........這裏部分代碼省略.........
            $fld = $rs->FetchField($i);
            print "<br> Field name is " . $fld->name;
            print " " . $rs->Fields($fld->name);
        }
    }
    print "<p>NUM TEST 2<br>";
    $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
    $rs = $db->query('select * from ADOXYZ order by id');
    for ($i = 0; $i < $rs->FieldCount(); $i++) {
        $fld = $rs->FetchField($i);
        print "<br> Field name is " . $fld->name;
        print " " . $rs->Fields($fld->name);
    }
    print "<p>ASSOC Test of SelectLimit<br>";
    $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
    $rs = $db->selectlimit('select * from ADOXYZ order by id', 3, 4);
    $cnt = 0;
    while ($rs && !$rs->EOF) {
        $cnt += 1;
        if (!isset($rs->fields['firstname'])) {
            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,\'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");
開發者ID:mvpphet,項目名稱:IntranetPaper,代碼行數:67,代碼來源:test.php

示例14: GetRowAssoc

 function GetRowAssoc($upper = ADODB_ASSOC_CASE)
 {
     if ($this->fetchMode == MYSQL_ASSOC && $upper == ADODB_ASSOC_CASE_LOWER) {
         $row = $this->fields;
     } else {
         $row = ADORecordSet::GetRowAssoc($upper);
     }
     return $row;
 }
開發者ID:kainabel,項目名稱:freech,代碼行數:9,代碼來源:adodb-mysql.inc.php

示例15: getNextByLoadId

 /**
  * Get next temporary stats record by load id.
  * @param $loadId string
  * @return mixed array or false if the end of
  * records is reached.
  */
 function getNextByLoadId($loadId)
 {
     if (!$this->_result || $this->_loadId != $loadId) {
         $this->_result = $this->_getGrouped($loadId);
         $this->_loadId = $loadId;
     }
     if ($this->_result->EOF) {
         return false;
     }
     $row = $this->_result->GetRowAssoc(false);
     $this->_result->MoveNext();
     return $row;
 }
開發者ID:laelnasan,項目名稱:UTFPR-ojs,代碼行數:19,代碼來源:UsageStatsTemporaryRecordDAO.inc.php


注:本文中的ADORecordSet類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。