references:joomla.framework:database:jdatabase-loadobjectlistTable of Contents
loadObjectList
Returns an array of database objects using the current SQL query. Returns false if the query fails. If the $key parameter is set, the array is indexed using the values of the field specified by key. Otherwise, the array is indexed sequentially. Syntaxarray loadObjectList ( $key )
ExamplesExample $dbo =& JFactory::getDBO(); $query = "SELECT bid, name, clickurl FROM #__banner"; $dbo->setQuery( $query ); $row =& $dbo->loadObjectList(); print_r( $row ); might produce: Result Array ( [0] => stdClass Object ( [bid] => 1 [name] => OSM 1 [clickurl] => http://www.opensourcematters.org ) [1] => stdClass Object ( [bid] => 2 [name] => OSM 2 [clickurl] => http://www.opensourcematters.org ) [2] => stdClass Object ( [bid] => 3 [name] => Joomla! [clickurl] => http://www.joomla.org ) [3] => stdClass Object ( [bid] => 4 [name] => Joomla! Forge [clickurl] => http://forge.joomla.org ) [4] => stdClass Object ( [bid] => 5 [name] => Joomla! Extensions [clickurl] => http://extensions.joomla.org ) ) Discussion |


