SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 69 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

If we specify the parameter key, the returned array uses the record key as the
array key:
$query = 'SELECT * FROM '#__test'';
$db =& JFactory::getDBO();
$db->setQuery($query);
print_r($db->loadObjectList());
Array
(
[0] => stdClass Object
(
[id] => 1
[name] => Foo
)
[1] => stdClass Object
(
[id] => 2
[name] => Bar
)
)
loadRow( ) : array
This method loads the first record as an array. This is useful when we are only
dealing with an individual record. If the query returns more than one record, the first
record in the result set will be used:
$query = 'SELECT * FROM '#__test'';
$db =& JFactory::getDBO();
$db->setQuery($query);
print_r($db->loadRow());
Array
(
[0] => 1
[1] => Foo
)
Chapter 3
[ 51 ]
loadRowList( key : int ) : array
This method loads an array of arrays or an associative array of arrays. If we specify
the parameter key, the returned array uses the record key as the array key. Unlike
the other load list methods, key is the logical position of the primary key field in the
result set:
$query = 'SELECT * FROM '#__test';
$db =& JFactory::getDBO();
$db->setQuery($query);
print_r($db->loadRowList(0));
Array
(
[0] => Array
(
[0] => 1
[1] => Foo
)
[1] => Array
(
[0] => 2
[1] => Bar
)
)
Using ADOdb
ADOdb is a PHP database abstraction layer released under the BSD license.


Pages:
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6