(Created page with "{{smcfunc |function=db_change_column |usage=$smcFunc['db_change_column'] (table_name, old_column, column_info, parameters, error) |description=This function allows for changing a...") |
No edit summary |
||
Line 22: | Line 22: | ||
<noinclude> | <noinclude> | ||
[[Category:Database Package Functions | [[Category:Database Package Functions]]</noinclude> | ||
Revision as of 21:47, 8 October 2012
Usage:
$smcFunc['db_change_column'] (table_name, old_column, column_info, parameters, error)
Description: This function allows for changing an existing column structure.
Parameters:
- 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.