|
Previous Page |
Solar_Sql_Adapter_Mysql |
Next Page |
createTable()
public
string
createTable (
string $table,
array $cols
)
Creates a portable table.
Inherited from Solar_Sql_Adapter.
Parameters
- (string)
$table: The name of the table to create. - (array)
$cols: Array of columns to create.
Returns
- (string) An SQL string.
Description
Creates a portable table.
The $cols parameter should be in this format ...
<?php
$cols = array(
'col_1' => array(
'type' => (string) bool, char, int, ...
'size' => (int) total length for char|varchar|numeric
'scope' => (int) decimal places for numeric
'default' => (bool) the default value, if any
'require' => (bool) is the value required to be NOT NULL?
'primary' => (bool) is this a primary key column?
'autoinc' => (bool) is this an auto-increment column?
),
'col_2' => array(...)
);
?>
For available field types, see Solar_Sql_Adapter::$_native.
Local
- Overview
- Constants
- Properties
- Methods
- __construct()
- __destruct()
- _checkIdentifier()
- _createSequence()
- _dropIndex()
- _dropSequence()
- _dsn()
- _exception()
- _fetchTableCols()
- _fetchTableList()
- _getCacheKey()
- _getDefault()
- _getTypeSizeScope()
- _modAutoincPrimary()
- _modIndexName()
- _modSelect()
- _modSequenceName()
- _nextSequence()
- _postConnect()
- _select()
- _sqlColdef()
- _sqlCreateTable()
- _sqlSelect()
- addColumn()
- apiVersion()
- begin()
- commit()
- connect()
- createIndex()
- createSequence()
- createTable()
- delete()
- disconnect()
- dropColumn()
- dropIndex()
- dropSequence()
- dropTable()
- dump()
- fetchAll()
- fetchAssoc()
- fetchCol()
- fetchOne()
- fetchPairs()
- fetchPdo()
- fetchSql()
- fetchTableCols()
- fetchTableList()
- fetchValue()
- getPdo()
- getProfile()
- insert()
- lastInsertId()
- locale()
- nextSequence()
- query()
- quote()
- quoteInto()
- quoteMulti()
- rollback()
- setProfiling()
- update()