====== loadObject ====== {#JAPI Joomla.Framework Database JDatabase::loadObject #} Loads an object with fields from the first row returned by the current SQL query. The method returns an object loaded with the data retrieved from the database. If the query fails, the method returns null. ===== Syntax ===== object loadObject () ===== Examples ===== $database =& JFactory::getDBO(); $sql = 'SELECT name, username FROM #__users'; $database->setQuery( $sql ); $user = NULL; $user = $database->loadObject(); echo 'Name: ' . $user->name . '
'; echo 'Username: ' . $user->username;
might produce: Name: Administrator Username: admin ---- ~~DISCUSSION~~