Documentation Menu

1.5 Template Project

The Joomla! Documentation Working Group is running a project to develop detailed reference and tutorial material on Joomla! 1.5 templates.  There is a project page on the documentation wiki where you can see the work in progress and help us by contributing your knowledge.

Who's Online

We have 3 guests online

Help Site License

The Joomla! Help Site content is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution NonCommercial ShareAlike 2.5. Some parts of this website may be subject to other licenses.
Home arrow Manual arrow 11. API Reference arrow [WORKING] mosDBTable->load

[WORKING] mosDBTable->load PDF Print E-mail

Last reviewed: Not reviewed
phpDocumentor

mosDBTable->load

Generic load object from database table row. Loads the properties of the mosDBTable object with the fields of the same name from the database table row specified.

Syntax

boolean load ( [ int $id ] )

$id
is the primary key id for the record to be loaded. This parameter is optional and if omitted will default to null.

Examples

Example:

global $database;
 
// Declare an instance of the user class.
$user = new mosUser( $database );
 
// Load the record with id 62.
$uid = 62;
if (!$user->load( $uid )) {
  echo "Error: Cannot load user with id $uid\n";
} else {
  echo "Name: " . $user->get( 'name' ) . "\n";
  echo "Username: " . $user->get( 'username' ) . "\n";
  echo "Usertype: " . $user->get( 'usertype' ) . "\n";
}

Please report any errors on this page to the Developer Documentation Forum.

Last Updated ( Monday, 25 December 2006 )
 
< Prev   Next >