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 67 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

Much of the Joomla! core
prefers methods that return objects.
For the purpose of these examples we won't bother using the nameQuote() and
Quote() methods.
The Database
[ 48 ]
loadResult( ) : string
This method loads value of the first cell in the result set. If we selected all the data
from our table, this method would return the ID for the first record, in this example:
1. This is useful when we want to access a single field in a known record. For
example, we might want to know the name of record 2:
$query = 'SELECT 'name' FROM '#__test' WHERE 'id'=2';
$db =& JFactory::getDBO();
$db->setQuery($query);
echo $db->loadResult();
Bar
loadResultArray( numinarray : int=0 ) : array
This method loads a column. numinarray is used to specify which column to get; the
column is identified by its logical position in the result set.
$query = 'SELECT 'name' FROM '#__test'';
$db =& JFactory::getDBO();
$db->setQuery($query);
print_r($db->loadResultArray());
Array
(
[0] => Foo
[1] => Bar
)
loadAssoc( ) : array
This method loads the first record as an associative array using the table column
names as array keys.


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