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


PHP msql_fetch_row函數代碼示例

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


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

示例1: getSpecialQuery

 /**
  * Obtain a list of a given type of objects
  *
  * @param string $type  the kind of objects you want to retrieve
  *
  * @return array  the array containing the list of objects requested
  *
  * @access protected
  * @see DB_common::getListOf()
  */
 function getSpecialQuery($type)
 {
     switch ($type) {
         case 'databases':
             $id = @msql_list_dbs($this->connection);
             break;
         case 'tables':
             $id = @msql_list_tables($this->dsn['database'], $this->connection);
             break;
         default:
             return null;
     }
     if (!$id) {
         return $this->msqlRaiseError();
     }
     $out = array();
     while ($row = @msql_fetch_row($id)) {
         $out[] = $row[0];
     }
     return $out;
 }
開發者ID:BackupTheBerlios,項目名稱:saecommerce,代碼行數:31,代碼來源:msql.php

示例2: sql_fetch_row

function sql_fetch_row(&$res, $nr = 0)
{
    global $dbtype;
    switch ($dbtype) {
        case "MySQL":
            $row = mysql_fetch_row($res);
            return $row;
            break;
        case "mSQL":
            $row = msql_fetch_row($res);
            return $row;
            break;
        case "postgres":
        case "postgres_local":
            if ($res->get_total_rows() > $res->get_fetched_rows()) {
                $row = pg_fetch_row($res->get_result(), $res->get_fetched_rows());
                $res->increment_fetched_rows();
                return $row;
            } else {
                return false;
            }
            break;
        case "ODBC":
        case "ODBC_Adabas":
            $row = array();
            $cols = odbc_fetch_into($res, $nr, $row);
            return $row;
            break;
        case "Interbase":
            $row = ibase_fetch_row($res);
            return $row;
            break;
        case "Sybase":
            $row = sybase_fetch_row($res);
            return $row;
            break;
        default:
            break;
    }
}
開發者ID:BackupTheBerlios,項目名稱:domsmod-svn,代碼行數:40,代碼來源:sql_layer.php

示例3: fetchInto

 /**
  * Fetch a row and insert the data into an existing array.
  *
  * Formating of the array and the data therein are configurable.
  * See DB_result::fetchInto() for more information.
  *
  * @param resource $result    query result identifier
  * @param array    $arr       (reference) array where data from the row
  *                            should be placed
  * @param int      $fetchmode how the resulting array should be indexed
  * @param int      $rownum    the row number to fetch
  *
  * @return mixed DB_OK on success, null when end of result set is
  *               reached or on failure
  *
  * @see DB_result::fetchInto()
  * @access private
  */
 function fetchInto($result, &$arr, $fetchmode, $rownum = null)
 {
     if ($rownum !== null) {
         if (!@msql_data_seek($result, $rownum)) {
             return null;
         }
     }
     if ($fetchmode & DB_FETCHMODE_ASSOC) {
         $arr = @msql_fetch_array($result, MSQL_ASSOC);
         if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
             $arr = array_change_key_case($arr, CASE_LOWER);
         }
     } else {
         $arr = @msql_fetch_row($result);
     }
     if (!$arr) {
         if ($error = @msql_error()) {
             return $this->raiseError($error);
         } else {
             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:5haman,項目名稱:knowledgetree,代碼行數:48,代碼來源:msql.php

示例4: fetchInto

 function fetchInto($result, &$ar, $fetchmode, $rownum = null)
 {
     if ($rownum !== null) {
         if (!@msql_data_seek($result, $rownum)) {
             return null;
         }
     }
     if ($fetchmode & DB_FETCHMODE_ASSOC) {
         $ar = @msql_fetch_array($result, MSQL_ASSOC);
     } else {
         $ar = @msql_fetch_row($result);
     }
     if (!$ar) {
         if ($error = msql_error()) {
             return $this->raiseError($error);
         } else {
             return null;
         }
     }
     return DB_OK;
 }
開發者ID:vojtajina,項目名稱:sitellite,代碼行數:21,代碼來源:msql.php

示例5: FetchResultArray

 function FetchResultArray($result, &$array, $row)
 {
     if (isset($this->limits[$result])) {
         if ($row > $this->limits[$result][1]) {
             return $this->SetError("Fetch result array", "attempted to retrieve a row beyhond the result limit");
         }
         $actual_row = $row + $this->limits[$result][0];
     } else {
         $actual_row = $row;
     }
     if (!msql_data_seek($result, $row) || !($array = msql_fetch_row($result))) {
         return $this->SetError("Fetch result array", msql_error());
     }
     $this->highest_fetched_row[$result] = max($this->highest_fetched_row[$result], $row);
     return $this->ConvertResultRow($result, $array);
 }
開發者ID:BackupTheBerlios,項目名稱:zvs,代碼行數:16,代碼來源:metabase_msql.php

示例6: FullSearchNextMatch

function FullSearchNextMatch($dbi, $res)
{
    global $WikiPageStore;
    if ($row = msql_fetch_row($res)) {
        return RetrievePage($dbi, $row[0], $WikiPageStore);
    } else {
        return 0;
    }
}
開發者ID:BackupTheBerlios,項目名稱:oralux,代碼行數:9,代碼來源:msql.php


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