smf_db_create_table

This function can be used to create a table without worrying about schema compatibilities across supported database systems. - If the table exists will, by default, do nothing. - Builds table with columns as passed to it - at least one column must be sent. The columns array should have one sub-array for each column - these sub arrays contain: 'name' = Column name 'type' = Type of column - values from (smallint, mediumint, int, text, varchar, char, tinytext, mediumtext, largetext) 'size' => Size of column (If applicable) - for example 255 for a large varchar, 10 for an int etc. If not set SMF will pick a size. - 'default' = Default value - do not set if no default required. - 'null' => Can it be null (true or false) - if not set default will be false. - 'auto' => Set to true to make it an auto incrementing column. Set to a numerical value to set from what it should begin counting. - Adds indexes as specified within indexes parameter. Each index should be a member of $indexes. Values are: - 'name' => Index name (If left empty SMF will generate). - 'type' => Type of index. Choose from 'primary', 'unique' or 'index'. If not set will default to 'index'. - 'columns' => Array containing columns that form part of key - in the order the index is to be created. - parameters: (None yet) - if_exists values: - 'ignore' will do nothing if the table exists. (And will return true) - 'overwrite' will drop any existing table of the same name. - 'error' will return false if the table already exists. - 'update' will update the table if the table already exists (no change of ai field and only colums with the same name keep the data)
Parameters Summary
string $table_name
array $columns
array $indexes = array ( )
array $parameters = array ( )
string $if_exists = 'ignore'
string $error = 'fatal'