db_change_column From Online Manual

Jump to: navigation, search


$smcFunc['db_change_column'] (table_name, old_column, column_info, parameters, error)

Description: This function allows for changing an existing column structure.


  • table_name (string) the name of an existing table
  • old_column (array) an array of data containing the following keys:
    • name (string) the name of the column
    • type (string) the type of the column (e.g. int, tinyint, varchar, text, etc.)
    • size (integer) defines the size of the column (if required by type)
    • null (boolean) whether to use null or not null
    • default (integer or string depending on type) should contain the default value for the column
    • auto (boolean) whether the column uses auto_increment or not
    • unsigned (boolean) specifies whether the column is unsigned or not (applicable only to MySQL).
  • column_info (array) deprecated as of 2.0 RC3, leave empty
  • parameters
  • error (string) what to do if an error was encountered, default fatal

Return: (bool) true if column added (changed); false otherwise.