本文整理汇总了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);
}
示例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;
}
示例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;
}
}
示例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;
}
}
}
示例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;*/
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}