Umil.table index add

From phpBB Development Wiki

umil::table_index_add –– Add an index/key on a database table using the Umil Library.

Contents

Description

string umil::table_index_add ( mixed $table_name [, string $index_name [, mixed $column ]] )

Parameters

Parameter Required/Default Usage
table_name Required The name of the database table to add the index to. You may just use phpbb_ for the table prefix if you would like. UMIL correctly sets the table prefix to the board's default if you enter in phpbb_
index_name default '' The name of the index/key to add
column default array() The column(s) the index will be for.

Return Values

Returns result or umil_end data

This article is a stub. You can help in improving Olympus Documentation by expanding it.


Examples

Example #1

Add an index named 'test_foo' for the column 'test_foo' to the database table named 'phpbb_test'

$umil->table_index_add('phpbb_test''test_foo''test_foo');

Example #2

Add an index named 'test_bar' for the columns 'test_lbar' and 'test_rbar' to the database table named 'phpbb_users'

$umil->table_index_add(USERS_TABLE'test_bar', array('test_lbar''test_rbar'));

Example #3

Adding multiple indexes with one function call

$umil->table_index_add(array(
    array(
'phpbb_test''test_foo''test_foo'),
    array(
USERS_TABLE'test_bar', array('test_lbar''test_rbar')),
));

See Also