(Created page with "{{smcfunc |function=db_add_index |usage=$smcFunc['db_add_index'](table_name, index_info, parameters, if_exists, error) |description=This function allows for adding an index to a ...") |
(refresh SMW properties) |
||
(One intermediate revision by one other user not shown) | |||
Line 16: | Line 16: | ||
|return=false if no columns specified. | |return=false if no columns specified. | ||
}} | }} | ||
<noinclude> | <noinclude> | ||
[[Category:Database Package Functions | [[Category:Database Package Functions]]</noinclude> | ||
Latest revision as of 16:44, 11 October 2012
Usage:
$smcFunc['db_add_index'](table_name, index_info, parameters, if_exists, error)
Description: This function allows for adding an index to a table.
Parameters:
- table_name an already existing table.
- index_info an array of data as follows:
- type (string) index type. Can be one of primary, unique, or index. Leave this entry out to keep a regular index.
- name (string) name of index, can be left blank to use first column name.
- columns (array) column names
- parameters none, leave empty.
- if_exists controls what to do if the index exists. If update (default value) updates the index but overwrites if primary, otherwise not.
- error what to do if an error was encountered. Default: fatal.
Return: false if no columns specified.