english/libraries/joomla/database/database.php
/**
	 * Method to get an array of the result set rows from the database query where each row is an associative array
	 * of ['field_name' => 'row_value'].  The array of rows can optionally be keyed by a field name, but defaults to
	 * a sequential numeric array.
	 *
	 * NOTE: Chosing to key the result array by a non-unique field name can result in unwanted
	 * behavior and should be avoided.
	 *
	 * @param   string  $key     The name of a field on which to key the result array.
	 * @param   string  $column  An optional column name. Instead of the whole row, only this column value will be in
	 *                           the result array.
	 *
	 * @return  mixed   The return value or null if the query failed.
	 *
	 * @since   11.1
	 * @throws  DatabaseException
	 */
Method to get an array of the result set rows from the database query where each row is an associative array
of ['field_name' => 'row_value'].  The array of rows can optionally be keyed by a field name, but defaults to
a sequential numeric array.

Chosing to key the result array by a non-unique field name can result in unwanted
behavior and should be avoided.

@param   string  $key     The name of a field on which to key the result array.
@param   string  $column  An optional column name. Instead of the whole row, only this column value will be in
the result array.

@return  mixed   The return value or null if the query failed.


Method to get an array of the result set rows from the database query where each row is an associative array of [ ' field_name ' = > ' row_value ' ] . The array of rows can optionally be keyed by a field name but defaults to a sequential numeric array . Chosing to key the result array by a non - unique field name can result in unwanted behavior and should be avoided . @param string $key The name of a field on which to key the result array . @param string $column An optional column name . Instead of the whole row only this column value will be in the result array . @return mixed The return value or null if the query failed .
public function loadAssocList($key = null, $column = null)
	{
		$array = array();
		if (!($cursor = $this->query())) {
			return null;
		}
		while ($row = $this->fetchAssoc($cursor))
		{
			$value = ($column) ? (isset($row[$column]) ? $row[$column] : $row) : $row;
			if ($key) {
				$array[$row[$key]] = $value;
			}
			else {
				$array[] = $value;
			}
		}
		$this->freeResult($cursor);
		return $array;
	}
public function loadAssocList ( $ key = null , $ column = null ) { $ array = array ( ) ; if ( ! ( $ cursor = $ this -> query ( ) ) ) { return null ; } while ( $ row = $ this -> fetchAssoc ( $ cursor ) ) { $ value = ( $ column ) ? ( isset ( $ row [ $ column ] ) ? $ row [ $ column ] : $ row ) : $ row ; if ( $ key ) { $ array [ $ row [ $ key ] ] = $ value ; } else { $ array [ ] = $ value ; } } $ this -> freeResult ( $ cursor ) ; return $ array ; }
Method to get an array of the result set rows from the database query where each row is an associative array
 of ['field_name' => 'row_value'].
Method to get an array of the result set rows from the database query where each row is an associative array of [ ' field_name ' = > ' row_value ' ] .
// Initialise variables. // Execute the query and get the result set cursor. // Get all of the rows from the result set. // Free up system resources and return.