Table of Contents

loadResultArray

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Database Class JDatabase Method loadResultArray Reference loadResultArray() Never Work in Progress

Returns an array containing a single field from all the rows returned by the database query.

Syntax

void loadResultArray ( $numinarray )

$numinarray integer is an integer containing the numeric offset of the field in the database row. This field is optional and if omitted will return the first field in each row (that is, field 0).

Examples

Example

$dbo =& JFactory::getDBO();

$query = "SELECT name, bid, clickurl FROM #__banner ORDER BY clickurl";
$dbo->setQuery( $query );
$row =& $dbo->loadResultArray(1);
print_r( $row );

might produce:

Result

Array ( [0] => 5 [1] => 4 [2] => 3 [3] => 1 [4] => 2 )