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


PHP sqlite_fetch_object函数代码示例

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


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

示例1: fetch_object

 public function fetch_object($ch, $cn = NULL)
 {
     if (isset($cn) && class_exists($cn)) {
         return sqlite_fetch_object($ch, $cn);
     }
     return sqlite_fetch_object($ch);
 }
开发者ID:robertosciarra,项目名称:vanilla-mvc,代码行数:7,代码来源:sqlite.dbd.php

示例2: db_single

function db_single($sql)
{
    global $db;
    $args = func_get_args();
    $sql = db_compile_query($sql, $args);
    $res = @sqlite_query($db, $sql);
    if ($res) {
        return @sqlite_fetch_object($res);
    }
    return false;
}
开发者ID:jbroadway,项目名称:pubmail,代码行数:11,代码来源:Database.php

示例3: sql_fetch_object

function sql_fetch_object($data)
{
    if (defined('DB_TYPE')) {
        if (DB_TYPE == 'mysql') {
            $sql = mysql_fetch_object($data);
        } elseif (DB_TYPE == 'sqlite') {
            $sql = sqlite_fetch_object($data);
        }
        return $sql;
    }
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:11,代码来源:sql_fetch_object.php

示例4: _fetch_object

 function _fetch_object()
 {
     if (function_exists('sqlite_fetch_object')) {
         return sqlite_fetch_object($this->result_id);
     } else {
         $arr = sqlite_fetch_array($this->result_id, SQLITE_ASSOC);
         if (is_array($arr)) {
             $obj = (object) $arr;
             return $obj;
         } else {
             return NULL;
         }
     }
 }
开发者ID:pepegarcia,项目名称:publicidadoficialdemo-1,代码行数:14,代码来源:sqlite_result.php

示例5: _fetch

 protected function _fetch()
 {
     $ret = sqlite_fetch_object($this->_idResult);
     return $ret;
     /*if($this->_fetchMode == jDbConnection::FETCH_CLASS){
           if ($this->_fetchModeCtoArgs)
               $ret =  sqlite_fetch_object ($this->_idResult, $this->_fetchModeParam, $this->_fetchModeCtoArgs);
           else
               $ret =  sqlite_fetch_object ($this->_idResult, $this->_fetchModeParam);
       }else{
           $ret =  sqlite_fetch_object ($this->_idResult);
       }
       return $ret;*/
 }
开发者ID:alienpham,项目名称:helenekling,代码行数:14,代码来源:sqlite.dbresultset.php

示例6: collectPreviousState

function collectPreviousState()
{
    if (($sql = sqlite_open(CM_HOME . '/etc/check.db', 0666, $sqliteerror)) === FALSE) {
        error_log("CheckP2P: impossible d'ouvrir la base de donnees");
        //@unlink ( SQLITE_DB );
    }
    if (($result = sqlite_query($sql, "SELECT * FROM state;")) === FALSE) {
        error_log("CheckP2P: impossible d'executer la requete SQLite");
        return FALSE;
    }
    while (($point = sqlite_fetch_object($result)) !== FALSE) {
        $points[$point->point] = $point;
    }
    sqlite_close($sql);
    return $points;
}
开发者ID:carriercomm,项目名称:bobonne,代码行数:16,代码来源:manager.inc.php

示例7: current

 public function current()
 {
     if ($this->_current_row !== $this->_internal_row and !$this->seek($this->_current_row)) {
         return NULL;
     }
     // Increment internal row for optimization assuming rows are fetched in order
     $this->_internal_row++;
     if ($this->_as_object === TRUE) {
         // Return an stdClass
         return sqlite_fetch_object($this->_result);
     } elseif (is_string($this->_as_object)) {
         // Return an object of given class name
         return sqlite_fetch_object($this->_result, $this->_as_object, $this->_object_params);
     } else {
         // Return an array of the row
         return sqlite_fetch_array($this->_result);
     }
 }
开发者ID:ametsuramet,项目名称:belajar_kohana,代码行数:18,代码来源:result.php

示例8: fetch

 public function fetch($query, $type = SEBODB_ASSOC)
 {
     $r = false;
     if (!is_resource($query)) {
         trigger_error('SeboDB:SQLite argument provided is not a valid result resource', E_USER_WARNING);
     }
     if ($type === SEBODB_ARRAY) {
         $r = sqlite_fetch_array($query, SQLITE_NUM);
     } elseif ($type === SEBODB_ASSOC) {
         $r = sqlite_fetch_array($query, SQLITE_ASSOC);
     } elseif ($type === SEBODB_OBJECT) {
         $r = sqlite_fetch_object($query);
     } elseif ($type === SEBODB_FIELD) {
         // FINISH ME FINISH ME FINISH ME
         $r = sqlite_fetch_array($query);
     } elseif ($type === SEBODB_LENGTHS) {
         $r = mysql_fetch_lengths($query);
     } else {
         trigger_error('SeboDB:SQLite invalid type argument', E_USER_WARNING);
     }
     return $r;
 }
开发者ID:BackupTheBerlios,项目名称:project-arc-svn,代码行数:22,代码来源:sqlite.inc.php

示例9: query

 /**
  * Database_SQLite::query
  *
  * Executes a SQL query and returns an array of row result objects.
  */
 function query($sql)
 {
     if (!empty($this->pdo)) {
         return $this->pdo->query($sql);
     }
     $result = sqlite_query($sql, $this->conn);
     $rows = array();
     if (is_resource($result)) {
         while ($row = sqlite_fetch_object($result)) {
             foreach (get_object_vars($row) as $key => $value) {
                 if (preg_match('/[\\w_]+\\.(.+)/', $key, $matches)) {
                     list(, $column_name) = $matches;
                     $row->{$column_name} = $value;
                 }
             }
             $rows[] = $row;
         }
     }
     $error = sqlite_last_error($this->conn);
     if (!empty($error)) {
         trigger_error("{$error} ({$sql})");
     }
     return $rows;
 }
开发者ID:kenyattaclark,项目名称:shiftspace,代码行数:29,代码来源:sqlite.php

示例10: fetchObject

 /**
  * Renvoie sous forme d'objet la ligne suivante dans le jeu de résultat
  * 
  * @access public
  * @return object
  */
 function fetchObject()
 {
     return sqlite_fetch_object($this->result);
 }
开发者ID:bibwho,项目名称:MATPbootstrap,代码行数:10,代码来源:sqlite.php

示例11: fetchObject

 /**
  * Fetch a result row as an object
  *
  * @param none
  * @return Array $this->sqlStoreValues
  */
 public function fetchObject()
 {
     $sqlStoreValues = array();
     while ($this->sqlRows = sqlite_fetch_object($this->sqlExec)) {
         $sqlStoreValues[] = $this->sqlRows;
     }
     $this->freeResult();
     return $sqlStoreValues;
 }
开发者ID:niteshapte,项目名称:define-mvc,代码行数:15,代码来源:SQLITEDriver.php

示例12: fetchAll

 /**
  * Public method:
  *	Returns an array with all rows of executed query.
  *       	this->fetchAll( $mode:Integer ):Array
  * @Param	Integer		PDO_FETCH_* constant to know how to read all rows, default PDO_FETCH_BOTH
  * 				NOTE: this doesn't work as fetch method, then it will use always PDO_FETCH_BOTH
  *                                    if this param is omitted
  * @Return	Array		An array with all fetched rows
  */
 function fetchAll($mode = PDO_FETCH_BOTH)
 {
     $result = array();
     if (!is_null($this->__result)) {
         switch ($mode) {
             case PDO_FETCH_NUM:
                 while ($r = sqlite_fetch_array($this->__result, SQLITE_NUM)) {
                     array_push($result, $r);
                 }
                 break;
             case PDO_FETCH_ASSOC:
                 while ($r = sqlite_fetch_array($this->__result, SQLITE_ASSOC)) {
                     array_push($result, $r);
                 }
                 break;
             case PDO_FETCH_OBJ:
                 while ($r = sqlite_fetch_object($this->__result)) {
                     array_push($result, $r);
                 }
                 break;
             case PDO_FETCH_BOTH:
             default:
                 while ($r = sqlite_fetch_array($this->__result, SQLITE_BOTH)) {
                     array_push($result, $r);
                 }
                 break;
         }
     }
     $this->__result = null;
     return $result;
 }
开发者ID:D4rk4,项目名称:Kusaba-z,代码行数:40,代码来源:PDOStatement_sqlite.class.php

示例13: fetch_object

 /**
  * Fetch a result row as an object
  *
  * @param   mixed $result
  * @return object
  */
 public function fetch_object($result)
 {
     return sqlite_fetch_object($result);
 }
开发者ID:atlcurling,项目名称:tkt,代码行数:10,代码来源:Sqlite.php

示例14: _fetch_object

 /**
  * Result - object
  *
  * Returns the result set as an object
  *
  * @param	string	$class_name
  * @return	object
  */
 protected function _fetch_object($class_name = 'stdClass')
 {
     return sqlite_fetch_object($this->result_id, $class_name);
 }
开发者ID:NaszvadiG,项目名称:codeigniter-database-standalone,代码行数:12,代码来源:sqlite_result.php

示例15: fetch_object

 function fetch_object($query, $case = 0)
 {
     $this->error = "";
     //Set the errors to none
     if ($this->debug) {
         $this->debugmsg("Fetching object on " . $this->dbtype . " database....", "blue");
         $this->debugmsg($query, "purple");
     }
     switch ($this->dbtype) {
         /* Firebird Functionality */
         case "firebird":
             $query = ibase_fetch_object($query);
             break;
             /* SQLite Functionality */
         /* SQLite Functionality */
         case "sqlite":
             $query = sqlite_fetch_object($query);
             break;
             /*DBASE - this uses the record counter - currentrecord */
         /*DBASE - this uses the record counter - currentrecord */
         case "dbase":
             if ($this->currentrecord <= $this->num_rows($none)) {
                 $temp = dbase_get_record_with_names($this->dbh, $this->currentrecord);
                 $this->currentrecord++;
                 foreach ($temp as $name => $value) {
                     $name = $name;
                     $value = str_replace("'", "''", $value);
                     $query->{$name} = trim($value);
                 }
             } else {
                 $query = false;
             }
             break;
             /* MYSQL Functionality */
         /* MYSQL Functionality */
         case "mysql":
             //echo $query;
             $query = mysql_fetch_object($query);
             break;
             /* Oracle Functionality */
         /* Oracle Functionality */
         case "oracle":
             $query = oci_fetch_object($query);
             break;
             /* MSSQL Functionality */
         /* MSSQL Functionality */
         case "mssql":
             $query = mssql_fetch_object($query);
             break;
             /* PGSQL Functionality */
         /* PGSQL Functionality */
         case "pgsql":
             $query = pg_fetch_object($query);
             break;
     }
     //because of field name differences i choose to make all results uppercase as with firebird conventions as default
     //print_r ($query);
     if ($case == 0) {
         if (is_object($query)) {
             foreach ($query as $name => $value) {
                 //Clean up the underscores and other characters
                 $testname = str_replace("_", "", $name);
                 if (ctype_lower($testname)) {
                     unset($query->{$name});
                 }
                 $name = strtoupper($name);
                 $query->{$name} = $value;
             }
         }
     } else {
         if (is_object($query)) {
             foreach ($query as $name => $value) {
                 //Clean up the underscores and other characters
                 $testname = str_replace("_", "", $name);
                 if (ctype_upper($testname)) {
                     unset($query->{$name});
                 }
                 $name = strtolower($name);
                 $query->{$name} = $value;
             }
         }
     }
     if ($this->debug) {
         $this->debugmsg("Fetched object for " . $this->dbtype . " database....", "green");
         $this->debugmsg($this->pre_r($query), "purple");
     }
     return $query;
 }
开发者ID:mortalerror,项目名称:ultimatesims,代码行数:88,代码来源:cdeclass.php


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