- 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:axmls:setprefix

# setPrefix

##### Syntax

    boolean setPrefix (
      string $prefix = ''
      optional bool $addUnderscore=true
      )

## Description

Sets a prefix for database objects

Call this method to set a standard prefix that will be prepended to all database tables and indexes.

If the optional `$addUnderscore` parameter is set, an underscore is automatically appended to the prefix.

## Usage

    /*
    * Assuming xml schema contains tables a,b,c
    */
    $axmls->setPrefix('test');

    /*
    * tables will be created as 'test_a','test_b','test_c'
    */

    $axmls->setPrefix('test',false);

    /*
    * tables will be created as 'testa','testb','testc'
    */

## Note

Some database restrict the length of table and index names. Ensure that the total length of prefix + table name does not exceed that limit.

v5/axmls/setprefix.txt · Last modified: 2016/01/12 17:26 by mnewnham

### Page Tools

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