|
|
Home Developer Manual 11. API Reference [REVIEW] database->loadObject |
| [REVIEW] database->loadObject |
|
|
|
|
Last reviewed: Not reviewed database->loadObjectLoads an object with fields from the first row returned by the current SQL query. If an object is passed as a parameter the fields of the row are bound to it and the updated object is returned. Syntaxboolean loadObject ( object &$bind_object )
ExamplesExample: In this example we allow loadObject to create an object for us. function getUser() { global $database; $sql = 'SELECT * FROM #__users'; $database->setQuery( $sql ); $user = NULL; $database->loadObject( $user ); echo "Name: $user->name\n"; echo "Username: $user->username\n"; } getUser(); might produce: Name: Administrator Username: admin Please report any errors on this page to the Developer Documentation Forum. |
|
| Last Updated ( Sunday, 24 December 2006 ) |
| < Prev | Next > |
|---|





