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


PHP sqlite_fetch_all函数代码示例

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


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

示例1: write_data

 /**
  * {@inheritdoc}
  */
 public function write_data($table_name)
 {
     if (!$this->is_initialized) {
         throw new extractor_not_initialized_exception();
     }
     $col_types = sqlite_fetch_column_types($this->db->get_db_connect_id(), $table_name);
     $sql = "SELECT *\n\t\t\tFROM {$table_name}";
     $result = sqlite_unbuffered_query($this->db->get_db_connect_id(), $sql);
     $rows = sqlite_fetch_all($result, SQLITE_ASSOC);
     $sql_insert = 'INSERT INTO ' . $table_name . ' (' . implode(', ', array_keys($col_types)) . ') VALUES (';
     foreach ($rows as $row) {
         foreach ($row as $column_name => $column_data) {
             if (is_null($column_data)) {
                 $row[$column_name] = 'NULL';
             } else {
                 if ($column_data == '') {
                     $row[$column_name] = "''";
                 } else {
                     if (strpos($col_types[$column_name], 'text') !== false || strpos($col_types[$column_name], 'char') !== false || strpos($col_types[$column_name], 'blob') !== false) {
                         $row[$column_name] = sanitize_data_generic(str_replace("'", "''", $column_data));
                     }
                 }
             }
         }
         $this->flush($sql_insert . implode(', ', $row) . ");\n");
     }
 }
开发者ID:MrAdder,项目名称:phpbb,代码行数:30,代码来源:sqlite_extractor.php

示例2: _fetchAll

 protected function _fetchAll($result)
 {
     $rows = sqlite_fetch_all($result, SQLITE_ASSOC);
     // free result?
     // rewind?
     return $rows;
 }
开发者ID:alanszlosek,项目名称:dbFacile,代码行数:7,代码来源:sqlite2.php

示例3: fetch

 public function fetch($res)
 {
     $result = array();
     $rows = sqlite_fetch_all($res, SQLITE_ASSOC);
     foreach ($rows as $data) {
         $result[] = (object) $data;
     }
     return $result;
 }
开发者ID:hendisantika,项目名称:ajax-crud-bootstrap,代码行数:9,代码来源:sqlite.php

示例4: dump

 public function dump()
 {
     $res = sqlite_query($con, self::ALL_GET_SQL);
     foreach (sqlite_fetch_all($res, SQLITE_ASSOC) as $row) {
         $this->cache[$row['name']] = unserialize($row['name']);
         $this->valueTime[$row['name']] = $row['time'];
     }
     var_dump($this->cache);
 }
开发者ID:kurari,项目名称:XSystem,代码行数:9,代码来源:store.sqlite.class.php

示例5: fetchAll

 function fetchAll($type = SQLITE_BOTH)
 {
     if ($type == 1) {
         $type = SQLITE_ASSOC;
     } elseif ($type == 2) {
         $type = SQLITE_NUM;
     } elseif ($type == 3 || $type != SQLITE_BOTH) {
         $type = SQLITE_BOTH;
     }
     //
     return sqlite_fetch_all($this->query, $type);
 }
开发者ID:Terrorboy,项目名称:SQLite,代码行数:12,代码来源:sqlite.class.php

示例6: getAll

 public function getAll($sql)
 {
     if ($sql) {
         $query = $this->query($sql);
         if ($query) {
             return sqlite_fetch_all($query);
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:13,代码来源:sqlite.php

示例7: fetchAll

 function fetchAll($query)
 {
     if ($this->handler) {
         $response = sqlite_query($this->handler, $query);
         if ($response) {
             return sqlite_fetch_all($response, SQLITE_ASSOC);
         } else {
             return false;
         }
     } else {
         die('データベースハンドラが見つかりません。');
     }
 }
开发者ID:miyamoto-shinji,项目名称:php_01,代码行数:13,代码来源:connection.php

示例8: load_popular_db_data

function load_popular_db_data($type = SQLITE_NUM)
{
    $db = get_db();
    $result = sqlite_query($db, "select url, count(*) from access_info group by url", $type);
    $temp_arr = sqlite_fetch_all($result);
    $ret_arr = array();
    foreach ($temp_arr as $sub_arr) {
        list($url, $cnt) = $sub_arr;
        $ret_arr[$url] = $cnt;
    }
    arsort($ret_arr);
    return array("hot" => array_slice($ret_arr, 0, 10), "good" => array_slice($ret_arr, 10, 10), "all" => $ret_arr);
}
开发者ID:sleepyycat,项目名称:WebFramework,代码行数:13,代码来源:sqlite_lib.php

示例9: sqliteAdapter

 /**
  * 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 sqliteAdapter($d)
 {
     parent::RecordSetAdapter($d);
     // grab all of the rows
     $fieldcount = sqlite_num_fields($d);
     // loop over all of the fields
     for ($i = 0; $i < $fieldcount; $i++) {
         // decode each field name ready for encoding when it goes through serialization
         // and save each field name into the array
         $this->columns[] = sqlite_field_name($d, $i);
     }
     if (sqlite_num_rows($d) > 0) {
         $this->rows = sqlite_fetch_all($d, SQLITE_NUM);
     }
 }
开发者ID:nimigeanu,项目名称:hollow,代码行数:21,代码来源:sqliteAdapter.php

示例10: jz_db_query

function jz_db_query($link, $sql)
{
    global $sql_type, $sql_pw, $sql_socket, $sql_db, $sql_usr;
    if (false !== ($res = jz_db_cache('query', $sql))) {
        return $res;
    }
    $results = @sqlite_query($link, $sql);
    if (!$results) {
        return false;
    }
    $res = sqlite_fetch_all($results, SQLITE_BOTH);
    $ret =& new sqlTable();
    $ret->data = $res;
    $ret->rows = sizeof($res);
    jz_db_cache('query', $sql, $res);
    return $ret;
}
开发者ID:seanfbrown,项目名称:jinzora,代码行数:17,代码来源:abstraction.php

示例11: execSQL

 public function execSQL($query)
 {
     $result = sqlite_query($this->db, $query);
     return sqlite_fetch_all($result, SQLITE_ASSOC);
 }
开发者ID:sleepyycat,项目名称:WebFramework,代码行数:5,代码来源:PostDB.class.php

示例12: remove_project

function remove_project($id, $type = SQLITE_NUM)
{
    $db = get_db2();
    $result = sqlite_query($db, "delete from project_info where id='{$id}'", $type);
    return sqlite_fetch_all($result);
}
开发者ID:sleepyycat,项目名称:WebFramework,代码行数:6,代码来源:sqlite_lib2.php

示例13: fetchAll

 /**
  * Renvoie un tableau de toutes les lignes du jeu de résultat
  * 
  * @param integer $mode  Mode de récupération des données
  * 
  * @access public
  * @return array
  */
 function fetchAll($mode = null)
 {
     if (is_null($mode)) {
         $mode = $this->fetchMode;
     }
     return sqlite_fetch_all($this->result, $mode);
 }
开发者ID:bibwho,项目名称:MATPbootstrap,代码行数:15,代码来源:sqlite.php

示例14: define

<?php

define("CODEDB", "../data/code_db");
if ($db = sqlite_open(CODEDB, 0666, $sqliteerror)) {
    $result = sqlite_query($db, 'select language from code_info', SQLITE_ASSOC);
    $ret_array = sqlite_fetch_all($result);
    $lang_list = array();
    foreach ($ret_array as $row_array) {
        array_push($lang_list, $row_array["language"]);
    }
    foreach (array_unique($lang_list) as $lang) {
        echo "<input name='lang_type' type=radio for='{$lang}''>{$lang}";
    }
}
开发者ID:sleepyycat,项目名称:WebFramework,代码行数:14,代码来源:load_select_boxes.php

示例15: selectArray

 public function selectArray($query)
 {
     $result = $this->query($query);
     if ($this->type == "PDO") {
         return $result->fetchAll();
     } else {
         if ($this->type == "SQLite3") {
             $arr = array();
             $i = 0;
             while ($res = $result->fetchArray()) {
                 $arr[$i] = $res;
                 $i++;
             }
             return $arr;
         } else {
             if ($this->type == "SQLite") {
                 return sqlite_fetch_all($result);
             }
         }
     }
 }
开发者ID:rogeriopradoj,项目名称:phpliteadmin,代码行数:21,代码来源:phpliteadmin.php


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