|
|
Home Developer Manual 11. API Reference [REVIEW] database->loadResultArray |
| [REVIEW] database->loadResultArray |
|
|
|
|
Last reviewed: Not reviewed database->loadResultArrayReturns an array containing a single field from all the rows returned by the database query. Syntaxarray loadResultArray ( [ integer $num_in_array ] )
Returns null if the last database query failed. ExamplesExample: This function prints an array of titles from the Joomla categories table. function getCategoryTitles() { global $database; $sql = 'SELECT id, title, description FROM #__categories'; $database->setQuery( $sql ); $titles = $database->loadResultArray( 1 ); print_r( $titles ); } getCategoryTitles(); might produce: Array
(
[0] => Latest
[1] => Joomla
[2] => Newsflash
[3] => Contacts
)
Please report any errors on this page to the Developer Documentation Forum. |
|
| Last Updated ( Monday, 25 December 2006 ) |
| < Prev | Next > |
|---|





