- skip to content

# Database Abstraction Layer

### User Tools

- Login

### Site Tools

- Recent changes
- Media Manager
- Sitemap

### Sidebar

##### Resources

- Reference Manual
- User Guide
- The Data Dictionary
- ADOdb-xmlschema
- ADOdb Active Record
- Performance Monitoring
- Date/Time Library
- Session Management Library
- Unsupported Addons
- Coding Standards

##### Supported Databases

- Access
- ADO
- CSV
- Firebird
- Frontbase
- IBM DB2
- Informix
- Interbase
- LDAP
- Microsoft SQL Server
- MySQL
- Netezza
- ODBC
- ODBTP
- Oracle
- PDO
- Postgresql
- SAP ADS
- SAP ASE
- SAP Maxdb
- SAP Sqlanywhere
- Sqlite
- Sybase
- Plain Text
- Visual Foxpro

##### Other

- Feature Comparison Matrix
- Connection Matrix
- Include File Guide

v5:activerecord:getattributenames

# getAttributeNames

##### Syntax

      mixed[] getAttributeNames()

## Description

This method returns the names of the columns in the table associated with an Active Record object.

## Usage

    $db->Execute("CREATE TEMPORARY TABLE `persons` (
                    `id` int(10) unsigned NOT NULL auto_increment,
                    `name_first` varchar(100) NOT NULL default '',
                    `name_last` varchar(100) NOT NULL default '',
                    `favorite_color` varchar(100) NOT NULL default '',
                    PRIMARY KEY  (`id`)
                ) ENGINE=MyISAM;
               ");

    class person extends ADOdb_Active_Record{}
    $person = new person();

    var_dump($person->getAttributeNames());

    /**
     * Outputs the following:
     * array(4) {
     *    [0]=> string(2) "id"
     *    [1]=> string(9) "name_first"
     *    [2]=> string(8) "name_last"
     *    [3]=> string(13) "favorite_color"
     *  }
     */

v5/activerecord/getattributenames.txt · Last modified: 2016/01/12 17:15 by mnewnham

### Page Tools

- Show pagesource
- Old revisions
- Backlinks
- Rename Page
- Back to top