(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 ...") |
No edit summary |
||
Line 18: | Line 18: | ||
<noinclude> | <noinclude> | ||
[[Category:Database Package Functions | [[Category:Database Package Functions]]</noinclude> | ||
Revision as of 21:46, 8 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.