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


PHP ADORecordSet_odbc::MoveNext方法代码示例

本文整理汇总了PHP中ADORecordSet_odbc::MoveNext方法的典型用法代码示例。如果您正苦于以下问题:PHP ADORecordSet_odbc::MoveNext方法的具体用法?PHP ADORecordSet_odbc::MoveNext怎么用?PHP ADORecordSet_odbc::MoveNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ADORecordSet_odbc的用法示例。


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

示例1: MetaColumns

 function MetaColumns($table)
 {
     global $ADODB_FETCH_MODE;
     $false = false;
     if ($this->uCaseTables) {
         $table = strtoupper($table);
     }
     $schema = '';
     $this->_findschema($table, $schema);
     $savem = $ADODB_FETCH_MODE;
     $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
     /*if (false) { // after testing, confirmed that the following does not work becoz of a bug
     			$qid2 = odbc_tables($this->_connectionID);
     			$rs = new ADORecordSet_odbc($qid2);		
     			$ADODB_FETCH_MODE = $savem;
     			if (!$rs) return false;
     			$rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
     			$rs->_fetch();
     			
     			while (!$rs->EOF) {
     				if ($table == strtoupper($rs->fields[2])) {
     					$q = $rs->fields[0];
     					$o = $rs->fields[1];
     					break;
     				}
     				$rs->MoveNext();
     			}
     			$rs->Close();
     			
     			$qid = odbc_columns($this->_connectionID,$q,$o,strtoupper($table),'%');
     		} */
     switch ($this->databaseType) {
         case 'access':
         case 'vfp':
             $qid = odbc_columns($this->_connectionID);
             #,'%','',strtoupper($table),'%');
             break;
         case 'db2':
             $colname = "%";
             $qid = odbc_columns($this->_connectionID, "", $schema, $table, $colname);
             break;
         default:
             $qid = @odbc_columns($this->_connectionID, '%', '%', strtoupper($table), '%');
             if (empty($qid)) {
                 $qid = odbc_columns($this->_connectionID);
             }
             break;
     }
     if (empty($qid)) {
         return $false;
     }
     $rs = new ADORecordSet_odbc($qid);
     $ADODB_FETCH_MODE = $savem;
     if (!$rs) {
         return $false;
     }
     $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
     $rs->_fetch();
     $retarr = array();
     /*
     $rs->fields indices
     0 TABLE_QUALIFIER
     1 TABLE_SCHEM
     2 TABLE_NAME
     3 COLUMN_NAME
     4 DATA_TYPE
     5 TYPE_NAME
     6 PRECISION
     7 LENGTH
     8 SCALE
     9 RADIX
     10 NULLABLE
     11 REMARKS
     */
     while (!$rs->EOF) {
         //	adodb_pr($rs->fields);
         if (strtoupper(trim($rs->fields[2])) == $table && (!$schema || strtoupper($rs->fields[1]) == $schema)) {
             $fld = new ADOFieldObject();
             $fld->name = $rs->fields[3];
             $fld->type = $this->ODBCTypes($rs->fields[4]);
             // ref: http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/dnaraccgen/html/msdn_odk.asp
             // access uses precision to store length for char/varchar
             if ($fld->type == 'C' or $fld->type == 'X') {
                 if ($this->databaseType == 'access') {
                     $fld->max_length = $rs->fields[6];
                 } else {
                     if ($rs->fields[4] <= -95) {
                         // UNICODE
                         $fld->max_length = $rs->fields[7] / 2;
                     } else {
                         $fld->max_length = $rs->fields[7];
                     }
                 }
             } else {
                 $fld->max_length = $rs->fields[7];
             }
             $fld->not_null = !empty($rs->fields[10]);
             $fld->scale = $rs->fields[8];
             $retarr[strtoupper($fld->name)] = $fld;
         } else {
//.........这里部分代码省略.........
开发者ID:chiranjeevjain,项目名称:agilebill,代码行数:101,代码来源:adodb-odbc.inc.php

示例2: strtoupper

 function &MetaColumns($table)
 {
     $table = strtoupper($table);
     /* // for some reason, cannot view only 1 table with odbc_columns -- bug?
     		$qid = odbc_tables($this->_connectionID);
     		$rs = new ADORecordSet_odbc($qid);
     		if (!$rs) return false;
     		while (!$rs->EOF) {
     			if ($table == strtoupper($rs->fields[2])) {
     				$q = $rs->fields[0];
     				$o = $rs->fields[1];
     				break;
     			}
     			$rs->MoveNext();
     		}
     		$rs->Close();
     		
     		$qid = odbc_columns($this->_connectionID,$q,$o,strtoupper($table),'%');
     	*/
     $qid = odbc_columns($this->_connectionID);
     $rs = new ADORecordSet_odbc($qid);
     if (!$rs) {
         return false;
     }
     $retarr = array();
     while (!$rs->EOF) {
         if (strtoupper($rs->fields[2]) == $table) {
             $fld = new ADOFieldObject();
             $fld->name = $rs->fields[3];
             $fld->type = $this->ODBCTypes($rs->fields[4]);
             $fld->max_length = $rs->fields[7];
             $retarr[strtoupper($fld->name)] = $fld;
         } else {
             if (sizeof($retarr) > 0) {
                 break;
             }
         }
         $rs->MoveNext();
     }
     $rs->Close();
     //-- crashes 4.03pl1 -- why?
     return $retarr;
 }
开发者ID:qoire,项目名称:portal,代码行数:43,代码来源:adodb-odbc.inc.php


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