API15

JDatabaseMySQL/loadResultArray: Difference between revisions

From Joomla! Documentation

m removing red link to edit, no existant pages
m preparing for archive only
 
Line 49: Line 49:


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=loadResultArray
  category=loadResultArray
  category=JDatabaseMySQL
  category=JDatabaseMySQL
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*

Latest revision as of 00:27, 25 March 2017

Description

Load an array of single field results into an array

[<! removed edit link to red link >]

<! 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

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 edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

Code Examples