references:joomla.framework:database:jdatabase-loadassocloadAssoc
Executes the current query and returns the first result row in an associative array. Syntaxvoid loadAssoc () ExamplesExample $dbo =& JFactory::getDBO(); $query = "SELECT name, clickurl FROM #__banner"; $dbo->setQuery( $query ); $row = $dbo->loadAssoc(); print_r( $row ); echo "<br />"; $row = $dbo->loadAssoc(); print_r( $row ); might produce: Result 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 |


