$database->createTable()
Creates a new table
$database->createTable(string $table, array $columns = [ ]): bool
Parameters
| Name | Type | Default |
|---|---|---|
| $tablerequired | string |
no default value |
| $columns | array |
[ ]
|
Return type
bool
This method modifies the existing $database object it is applied to and returns it again.
Parent class
Examples
$database->createTable('product', [
'id' => ['type' => 'id'],
'code' => ['type' => 'varchar', 'size' => 50],
'description' => ['type' => 'varchar'],
'quantity' => ['type' => 'int', 'unsigned' => false],
'price' => ['type' => 'decimal', 'precision' => 12, 'decimal_places' => 4]
]);