1.5 Template Project

The Joomla! Documentation Working Group is running a project to develop detailed reference and tutorial material on Joomla! 1.5 templates.  There is a project page on the documentation wiki where you can see the work in progress and help us by contributing your knowledge.

Who's Online

We have 1 guest online

Help Site License

The Joomla! Help Site content is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution NonCommercial ShareAlike 2.5. Some parts of this website may be subject to other licenses.
Home arrow Developer Manual arrow 11. API Reference arrow [REVIEW] database->loadRow

[REVIEW] database->loadRow PDF Print E-mail

Last reviewed: Not reviewed
phpDocumentor

database->loadRow

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

Syntax

array loadRow ( )

Examples

Example: This function prints an array containing all the fields from a given Joomla category record.

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

might produce:

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] => 2000-00-00 00:00:00
    [11] => 
    [12] => 0
    [13] => 0
    [14] => 1
    [15] => 
)
 

Please report any errors on this page to the Developer Documentation Forum.

Last Updated ( Monday, 25 December 2006 )
 
< Prev   Next >