Db change column: Difference between revisions From Online Manual

Jump to: navigation, search
(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...")
 
m (refresh SMW properties)
 
(One intermediate revision by one other user not shown)
Line 20: Line 20:
|return=(bool) true if column added (changed); false otherwise.
|return=(bool) true if column added (changed); false otherwise.
}}
}}
<noinclude>
<noinclude>
[[Category:Database Package Functions]]
[[Category:Database Package Functions]]</noinclude>
[[Category:2.0]]
[[Category:Customizing SMF]]
[[Category:Developing SMF]]</noinclude>

Latest revision as of 16:45, 11 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.



Advertisement: