JDatabaseMySQL/loadResultArray: Difference between revisions
From Joomla! Documentation
m clean up |
m preparing for archive only |
||
| Line 45: | Line 45: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=loadResultArray | category=loadResultArray | ||
category=JDatabaseMySQL | category=JDatabaseMySQL | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
Latest revision as of 01:28, 25 March 2017
Description
Load an array of single field results into an array
<! removed transcluded page call, red link never existed >
Syntax
loadResultArray($numinarray=0)
| Parameter Name | Default Value | Description |
|---|---|---|
| $numinarray | 0 |
Defined in
libraries/joomla/database/database/mysql.php
Importing
jimport( 'joomla.database.database.mysql' );
Source Body
public function loadResultArray($numinarray = 0)
{
if (!($cur = $this->query())) {
return null;
}
$array = array();
while ($row = mysql_fetch_row($cur)) {
$array[] = $row[$numinarray];
}
mysql_free_result($cur);
return $array;
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples