API16:JTable/getFields
From Joomla! Documentation
Description
Get the columns from database table.
Syntax
getFields()
Returns
mixed An array of the field names, or false if an error occurs.
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
public function getFields()
{
static $cache = null;
if ($cache === null)
{
// Lookup the fields for this table only once.
$name = $this->getTableName();
$fields = $this->_db->getTableFields($name, false);
if (!isset($fields[$name])) {
$this->setError(JText::_('JTable_Error_Columns_not_found'));
return false;
}
$cache = $fields[$name];
}
return $cache;
}
Examples
Code Examples