API15

JDatabaseMySQL/loadObject: Difference between revisions

From Joomla! Documentation

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


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

Latest revision as of 00:27, 25 March 2017

Description

This global function loads the first row of a query into an object

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

loadObject()


Returns

object

Defined in

libraries/joomla/database/database/mysql.php

Importing

jimport( 'joomla.database.database.mysql' );

Source Body

function loadObject( )
{
        if (!($cur = $this->query())) {
                return null;
        }
        $ret = null;
        if ($object = mysql_fetch_object( $cur )) {
                $ret = $object;
        }
        mysql_free_result( $cur );
        return $ret;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

Code Examples