Table of Contents

loadRow

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

Returns the first row of the current query as an array. If the query fails then returns null.

Syntax

array loadRow ()

Examples

This example prints an array containing all the fields from a given Joomla! category record.

Example

$database =& JFactory::getDBO();

$title = $database->Quote( 'Latest' );
$sql = "SELECT * FROM #__categories WHERE title=$title";
$database->setQuery( $sql );
$category = $database->loadRow();
print_r( $category );

might produce:

Result

Array ( [0] => 1 [1] => 0 [2] => Latest [3] => Latest News [4] => taking_notes.jpg [5] => 1 [6] => left [7] => The latest news from the Joomla! Team [8] => 1 [9] => 0 [10] => 0000-00-00 00:00:00 [11] => [12] => 1 [13] => 0 [14] => 1 [15] => )