db_create_table

Definition

db_create_table(&$ret, $name, $table)
includes/database.inc, line 510

Description

Create a new table from a Drupal table definition.

Parameters

$ret Array to which query results will be added.

$name The name of the table to create.

$table A Schema API table definition array.

Related topics

Namesort iconDescription
Schema APIA Drupal schema definition is an array structure representing one or more tables and their related keys and indexes. A schema is defined by hook_schema(), which usually lives in a modulename.install file.

Code

<?php
function db_create_table(&$ret, $name, $table) {
  $statements = db_create_table_sql($name, $table);
  foreach ($statements as $statement) {
    $ret[] = update_sql($statement);
  }
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.