PHP: sqlite_fetch_object - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

sqlite_fetch_single sqlite_fetch_column_types

Last updated: Fri, 26 Jan 2007

view this page in

# sqlite_fetch_object

(PHP 5)

sqlite_fetch_object -- Выбирает следующую запись из результата запроса и возвращает объект

## Описание

object sqlite_fetch_object ( resource result [, string class_name [, array ctor_params [, bool decode_binary]]] )

Внимание
К настоящему времени эта функция еще не была документирована; для ознакомления доступен только список аргументов.

add a note User Contributed Notes
sqlite_fetch_object
florian at phpws dot org
12-Aug-2006 10:13
`Here is the function from "cscm at meuh dot dyndns dot org" rewriten.
I think it will work better when really assigning the values ;-)
Also I'd replace the empty "bidon" class by stdClass wich is such an empty class and is provided by default.
// Fetch resultset as an object
function sqlite_fetch_object(&$resource){
$arr = sqlite_fetch_array($resource);
$obj = new stdClass();
foreach ($arr as $key => $value) {
# Check is valid $T_VARIABLE
if (ereg(\"[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\", $key)) {
$obj->$key = $value;
}
}
return $obj;
}`
vbwebprofi at gmx dot de
11-Mar-2006 07:39
`Here a light workaround for PHP 4.x which I use in my DBAccess class :
<?
function sqlite_fetch_object(&$result) {
$vO = sqlite_fetch_array($result, SQLITE_ASSOC);
if($vO) {
$vO = (object) $vO;
}
return $vO;
}
?>
HTH Holger`
cscm at meuh dot dyndns dot org
04-Feb-2006 04:35
`As the sqlite_fetch_object function is not implemented in the PECL extension version 1.0.3.
I�ve rewrite the sqlite_fetch_object in PHP :
// An empty class
class bidon {
}
// Fetch resultset as an object
function sqlite_fetch_object(&$resource){
$arr = sqlite_fetch_array($resource);
$obj = new bidon();
foreach ($arr as $key => $value) {
# Check is valid $T_VARIABLE
if (ereg(\"[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\", $key)) {
$obj->$key;
}
}
return $obj;
}
Voila`
Benjamin
21-Sep-2004 10:34
`This function is not implemented in the PECL extension version 1.0.3 http://pecl.php.net/package/SQLite/1.0.3`
add a note
sqlite_fetch_single sqlite_fetch_column_types

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST