Fungsi loadAssocList menghasilkan baris data dari table di database, penamaan index berdasarkan nama field.

Syntaxnya ditulisakan sebagai berikut.

{xtypo_code}array loadAssocList ( string $key ){/xtypo_code}
$key adalah nama field dari primary key. Parameter ini bersifat opsional dan jika tidak diisi maka defaultnya adalah kosong.

Contoh:

{xtypo_code}function getCategories() {
global $database;
$sql = 'SELECT * FROM #jos_categories';
$database->setQuery( $sql );
$rows = $database->loadAssocList();
print_r( $rows );
}
getCategories();{/xtypo_code}

Maka akan menghasilkan output sebagai berikut.

{xtypo_code}Array
(
[0] => Array
(
[id] => 1
[parent_id] => 0
[title] => Latest
[name] => Latest News
[image] => taking_notes.jpg
[section] => 1
[image_position] => left
[description] => The latest news from the Joomla Team
[published] => 1
[checked_out] => 0
[checked_out_time] => 2000-00-00 00:00:00
[editor] =>
[ordering] => 0
[access] => 0
[count] => 1
[params] =>
)
[1] => Array
(
[id] => 2
[parent_id] => 0
[title] => Joomla
[name] => Joomla
[image] => clock.jpg
[section] => com_weblinks
[image_position] => left
[description] => A selection of links that are all related to the Joomla project.
[published] => 1
[checked_out] => 0
[checked_out_time] => 0000-00-00 00:00:00
[editor] =>
[ordering] => 0
[access] => 0
[count] => 0
[params] =>
)
}{/xtypo_code}