- 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:dictionary:metaprimarykeys

# metaPrimaryKeys

##### See Also

metaIndexes()

##### Syntax

      mixed metaPrimaryKeys(
          string $tableName,
          optional string $owner=false,
          )

## Description

The function `metaPrimaryKeys()` returns the column names in the primary key associated with a specific table as a numeric array . If there are no primary keys then the function returns false.

## Optional Parameters

### $owner

If specified, only returns primary keys associated with a table owned by that name.

## Usage

    /*
     * Connection to DB2 sample database assumed
     */
    $mpk = $db->metaPrimaryKeys('ACT');
    print_r($mpk);
    /*
     * Prints
    Array
    (
        [0] => ACTNO
    )

     */

v5/dictionary/metaprimarykeys.txt · Last modified: 2016/01/12 17:06 by mnewnham

### Page Tools

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