====== loadAssoc ====== {#JAPI Joomla.Framework Database JDatabase::loadAssoc #} Executes the current query and returns the first result row in an associative array. ===== Syntax ===== void loadAssoc () ===== Examples ===== $dbo =& JFactory::getDBO(); $query = "SELECT name, clickurl FROM #__banner"; $dbo->setQuery( $query ); $row = $dbo->loadAssoc(); print_r( $row ); echo "
"; $row = $dbo->loadAssoc(); print_r( $row );
might produce: Array ( [name] => OSM 1 [clickurl] => http://www.opensourcematters.org ) Array ( [name] => OSM 1 [clickurl] => http://www.opensourcematters.org ) Note that this method can only be used to obtain the first result (as illustrated above). ---- ~~DISCUSSION~~