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


PHP fbsql_fetch_row函数代码示例

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


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

示例1: pgsqlAdapter

 /**
  * Constructor method for the adapter.  This constructor implements the setting of the
  * 3 required properties for the object.
  * 
  * @param resource $d The datasource resource
  */
 function pgsqlAdapter($d)
 {
     parent::RecordSetAdapter($d);
     $fieldcount = fbsql_num_fields($d);
     $ob = "";
     $be = $this->isBigEndian;
     $fc = pack('N', $fieldcount);
     if (fbsql_num_rows($d) > 0) {
         fbsql_data_seek($d, 0);
         while ($line = fbsql_fetch_row($d)) {
             // write all of the array elements
             $ob .= "\n" . $fc;
             foreach ($line as $value) {
                 // write all of the array elements
                 if (is_string($value)) {
                     // type as string
                     $os = $this->_directCharsetHandler->transliterate($value);
                     //string flag, string length, and string
                     $len = strlen($os);
                     if ($len < 65536) {
                         $ob .= "" . pack('n', $len) . $os;
                     } else {
                         $ob .= "\f" . pack('N', $len) . $os;
                     }
                 } elseif (is_float($value) || is_int($value)) {
                     // type as double
                     $b = pack('d', $value);
                     // pack the bytes
                     if ($be) {
                         // if we are a big-endian processor
                         $r = strrev($b);
                     } else {
                         // add the bytes to the output
                         $r = $b;
                     }
                     $ob .= "" . $r;
                 } elseif (is_bool($value)) {
                     //type as bool
                     $ob .= "";
                     $ob .= pack('c', $value);
                 } elseif (is_null($value)) {
                     // null
                     $ob .= "";
                 }
             }
         }
     }
     $this->serializedData = $ob;
     $this->numRows = fbsql_num_rows($d);
     for ($i = 0; $i < $fieldcount; $i++) {
         $this->columnNames[$i] = $this->_charsetHandler->transliterate(fbsql_field_name($d, $i));
     }
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:59,代码来源:fbsqlAdapter.php

示例2: fbsqlAdapter

 /**
  * Constructor method for the adapter.  This constructor implements the setting of the
  * 3 required properties for the object.
  * 
  * @param resource $d The datasource resource
  */
 function fbsqlAdapter($d)
 {
     parent::RecordSetAdapter($d);
     $fieldcount = fbsql_num_fields($d);
     for ($i = 0; $i < $fieldcount; $i++) {
         $this->columns[] = fbsql_field_name($d, $i);
     }
     if (fbsql_num_rows($d) > 0) {
         fbsql_data_seek($d, 0);
         while ($line = fbsql_fetch_row($d)) {
             $this->rows[] = $line;
         }
     }
 }
开发者ID:FalconGT,项目名称:DrEvony,代码行数:20,代码来源:fbsqlAdapter.php

示例3: fetchInto

 /**
  * Places a row from the result set into the given array
  *
  * Formating of the array and the data therein are configurable.
  * See DB_result::fetchInto() for more information.
  *
  * This method is not meant to be called directly.  Use
  * DB_result::fetchInto() instead.  It can't be declared "protected"
  * because DB_result is a separate object.
  *
  * @param resource $result    the query result resource
  * @param array    $arr       the referenced array to put the data in
  * @param int      $fetchmode how the resulting array should be indexed
  * @param int      $rownum    the row number to fetch (0 = first row)
  *
  * @return mixed  DB_OK on success, NULL when the end of a result set is
  *                 reached or on failure
  *
  * @see DB_result::fetchInto()
  */
 function fetchInto($result, &$arr, $fetchmode, $rownum = null)
 {
     if ($rownum !== null) {
         if (!@fbsql_data_seek($result, $rownum)) {
             return null;
         }
     }
     if ($fetchmode & DB_FETCHMODE_ASSOC) {
         $arr = @fbsql_fetch_array($result, FBSQL_ASSOC);
         if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
             $arr = array_change_key_case($arr, CASE_LOWER);
         }
     } else {
         $arr = @fbsql_fetch_row($result);
     }
     if (!$arr) {
         return null;
     }
     if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
         $this->_rtrimArrayValues($arr);
     }
     if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
         $this->_convertNullArrayValuesToEmpty($arr);
     }
     return DB_OK;
 }
开发者ID:roojs,项目名称:pear,代码行数:46,代码来源:fbsql.php

示例4: fetchInto

 /**
  * Fetch a row and insert the data into an existing array.
  *
  * @param $result fbsql result identifier
  * @param $arr (reference) array where data from the row is stored
  * @param $fetchmode how the array data should be indexed
  * @param   $rownum the row number to fetch
  * @access public
  *
  * @return int DB_OK on success, a DB error on failure
  */
 function fetchInto($result, &$arr, $fetchmode, $rownum = null)
 {
     if ($rownum !== null) {
         if (!@fbsql_data_seek($result, $rownum)) {
             return null;
         }
     }
     if ($fetchmode & DB_FETCHMODE_ASSOC) {
         $arr = @fbsql_fetch_array($result, FBSQL_ASSOC);
     } else {
         $arr = @fbsql_fetch_row($result);
     }
     if (!$arr) {
         $errno = @fbsql_errno($this->connection);
         if (!$errno) {
             return NULL;
         }
         return $this->fbsqlRaiseError($errno);
     }
     return DB_OK;
 }
开发者ID:BackupTheBerlios,项目名称:e-maku-svn,代码行数:32,代码来源:fbsql.php

示例5: fetchInto

 /**
  * Fetch a row and return data in an array.
  *
  * @param resource $result result identifier
  * @param int $fetchmode ignored
  * @param int $rownum the row number to fetch
  * @return mixed data array or NULL on success, a MDB error on failure
  * @access public
  */
 function fetchInto($result, $fetchmode = MDB_FETCHMODE_DEFAULT, $rownum = NULL)
 {
     $result_value = intval($result);
     if ($rownum == NULL) {
         ++$this->highest_fetched_row[$result_value];
     } else {
         if (!@fbsql_data_seek($result, $rownum)) {
             return NULL;
         }
         $this->highest_fetched_row[$result_value] = max($this->highest_fetched_row[$result_value], $rownum);
     }
     if ($fetchmode == MDB_FETCHMODE_DEFAULT) {
         $fetchmode = $this->fetchmode;
     }
     if ($fetchmode & MDB_FETCHMODE_ASSOC) {
         $row = @fbsql_fetch_assoc($result);
         if (is_array($row) && $this->options['optimize'] == 'portability') {
             $row = array_change_key_case($row, CASE_LOWER);
         }
     } else {
         $row = @fbsql_fetch_row($result);
     }
     if (!$row) {
         if ($this->options['autofree']) {
             $this->freeResult($result);
         }
         return NULL;
     }
     if (isset($this->result_types[$result_value])) {
         $row = $this->convertResultRow($result, $row);
     }
     return $row;
 }
开发者ID:Esleelkartea,项目名称:kz-adeada-talleres-electricos-,代码行数:42,代码来源:fbsql.php

示例6: fetchRow

 public function fetchRow()
 {
     if (!empty($this->query)) {
         return fbsql_fetch_row($this->query);
     } else {
         return 0;
     }
 }
开发者ID:Allopa,项目名称:ZN-Framework-Starter,代码行数:8,代码来源:FbsqlDriver.php

示例7: array_change_key_case

 /**
  * Fetch a row and insert the data into an existing array.
  *
  * @param int       $fetchmode  how the array data should be indexed
  * @param int    $rownum    number of the row where the data can be found
  * @return int data array on success, a MDB2 error on failure
  * @access public
  */
 function &fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT, $rownum = null)
 {
     if (null !== $rownum) {
         $seek = $this->seek($rownum);
         if (MDB2::isError($seek)) {
             return $seek;
         }
     }
     if ($fetchmode == MDB2_FETCHMODE_DEFAULT) {
         $fetchmode = $this->db->fetchmode;
     }
     if ($fetchmode == MDB2_FETCHMODE_ASSOC || $fetchmode == MDB2_FETCHMODE_OBJECT) {
         $row = @fbsql_fetch_assoc($this->result);
         if (is_array($row) && $this->db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
             $row = array_change_key_case($row, $this->db->options['field_case']);
         }
     } else {
         $row = @fbsql_fetch_row($this->result);
     }
     if (!$row) {
         if (false === $this->result) {
             $err =& $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, 'resultset has already been freed', __FUNCTION__);
             return $err;
         }
         $null = null;
         return $null;
     }
     $mode = $this->db->options['portability'] & MDB2_PORTABILITY_EMPTY_TO_NULL;
     if ($mode) {
         $this->db->_fixResultArrayValues($row, $mode);
     }
     if ($fetchmode == MDB2_FETCHMODE_ORDERED) {
         if (!empty($this->types)) {
             $row = $this->db->datatype->convertResultRow($this->types, $row, $rtrim);
         }
     } elseif (!empty($this->types_assoc)) {
         $row = $this->db->datatype->convertResultRow($this->types_assoc, $row, $rtrim);
     }
     if (!empty($this->values)) {
         $this->_assignBindColumns($row);
     }
     if ($fetchmode === MDB2_FETCHMODE_OBJECT) {
         $object_class = $this->db->options['fetch_class'];
         if ($object_class == 'stdClass') {
             $row = (object) $row;
         } else {
             $row = new $object_class($row);
         }
     }
     ++$this->rownum;
     return $row;
 }
开发者ID:Dulciane,项目名称:jaws,代码行数:60,代码来源:fbsql.php


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