db_add_index From Online Manual

Revision as of 13:55, 21 October 2011 by Emanuele (talk | contribs) (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 ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.



Advertisement: