Umil.table column add

umil::table_column_add –– Add a column to a database table using the Umil Library.

Description
string umil::table_column_add ( mixed $table_name [, string $column_name [, array $column_data ]] )

Return Values
Returns result or umil_end data

Column Data
Information for setting up the column data is here. This should be given as an array with the column name being the array key and the value being an array with the data.

In the value array holding the information, the first item is the Database_Type_Map, the second item is the default value, and the third item is optional and to be used for special fields.

For example, setting up an auto increment column: 'user_id'	=> array('UINT', NULL, 'auto_increment')

Or a description field, say for the forum description: 'forum_desc'	=> array('TEXT_UNI', ''),

Example #1
Add a UINT (unsigned mediumint in MySQL) with the default of 0 column named 'test_foo' to the phpbb_test table. $umil->table_column_add('phpbb_test', 'test_foo', array('UINT', 0));

Example #2
Add a VCHAR (varchar(255) in MySQL) with the default of 'hello' column named 'test_bar' to the phpbb_users table. $umil->table_column_add(USERS_TABLE, 'test_bar', array('VCHAR', 'hello'));

Example #3
Adding multiple columns with one function call $umil->table_column_add(array( array('phpbb_test', 'test_foo', array('UINT', 0)), array(USERS_TABLE, 'test_bar', array('VCHAR', 'hello')), ));

Example #4
adding a boolean column (Tinyint in Mysql, char(1) in oracle, bit in mssql) using the automatic syntax : 'table_column_add' => array( array('phpbb_test', 'test_foo', array('BOOL', 0)), ),