API17

Difference between revisions of "JDatabase::loadAssocList"

From Joomla! Documentation

(Layout updates)
(Updated to r1448:247ba8d88526)
Line 2: Line 2:
 
=={{JVer|11.1}} JDatabase::loadAssocList==
 
=={{JVer|11.1}} JDatabase::loadAssocList==
 
===Description===
 
===Description===
Load a associactive list of database rows.  
+
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'].  
  
 
{{Description:JDatabase::loadAssocList}}
 
{{Description:JDatabase::loadAssocList}}
Line 8: Line 8:
 
<nowiki>[</nowiki>[[Description:JDatabase::loadAssocList|Edit Descripton]]<nowiki>]</nowiki>
 
<nowiki>[</nowiki>[[Description:JDatabase::loadAssocList|Edit Descripton]]<nowiki>]</nowiki>
 
</span>
 
</span>
===Synopsis===
 
 
<source lang="php">
 
<source lang="php">
public JDatabase::loadAssocList ($key=null, $column=null)
+
public function loadAssocList (
 +
        $key=null
 +
        $column=null
 +
)
 
</source>
 
</source>
 
{| class="wikitable"
 
{| class="wikitable"
Line 20: Line 22:
 
|-
 
|-
 
|$key
 
|$key
|string
+
|
 
|null
 
|null
|The field name of a primary key
+
|
 
|-
 
|-
 
|$column
 
|$column
|string
+
|
 
|null
 
|null
|An optional column name. Instead of the whole row, only this column value will be in the return array.
+
|
 
|-
 
|-
 
|}
 
|}
===Returns===
+
* '''Returns'''
array If key is empty as sequential list of returned records.
+
* '''Defined''' on line 573 of libraries/joomla/database/database.php
===Defined in===
 
libraries/joomla/database/database.php (line 670)
 
* see source code in [[jplatform:database/database.php#cl-670|BitBucket]]
 
===Referenced by===
 
 
===See also===
 
===See also===
 +
* {{JVer|11.1}} '''JDatabase::loadAssocList source code''' on [[jplatform:database/database.php#cl-565|BitBucket]]
 +
* {{JVer|11.1}} Class [[JDatabase/11.1|JDatabase]]
 +
* {{JVer|11.1}} Subpackage [[Subpackage_Database/11.1|Database]]
 +
* [[JDatabase::loadAssocList|Other versions of JDatabase::loadAssocList]]
 +
{{SeeAlso:JDatabase::loadAssocList}}
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JDatabase::loadAssocList|Edit See Also]]<nowiki>]</nowiki>
 
<nowiki>[</nowiki>[[SeeAlso:JDatabase::loadAssocList|Edit See Also]]<nowiki>]</nowiki>
 
</span>
 
</span>
* [[JDatabase/11.1|JDatabase]]
+
===User contributed notes===
* [[JDatabase::loadAssocList|Other versions of this method]]
 
{{SeeAlso:JDatabase::loadAssocList}}
 
===Examples===
 
 
<CodeExamplesForm />
 
<CodeExamplesForm />
 
<dpl>
 
<dpl>
Line 51: Line 51:
 
category=MethodExample
 
category=MethodExample
 
include=*
 
include=*
 +
namespace=CodeExample
 
format= ,,,
 
format= ,,,
 
</dpl>
 
</dpl>
 
<noinclude>[[Category:JDatabase]][[Category:JDatabase::loadAssocList]]</noinclude>
 
<noinclude>[[Category:JDatabase]][[Category:JDatabase::loadAssocList]]</noinclude>

Revision as of 20:26, 27 April 2011

The "API17" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Joomla 11.1 JDatabase::loadAssocList[edit]

Description[edit]

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'].

Template:Description:JDatabase::loadAssocList [Edit Descripton]

public function loadAssocList (
        $key=null
        $column=null
)
Parameter Type Default Description
$key null
$column null
  • Returns
  • Defined on line 573 of libraries/joomla/database/database.php

See also[edit]

Template:SeeAlso:JDatabase::loadAssocList [Edit See Also]

User contributed notes[edit]

<CodeExamplesForm />