You are here

function _demo_dump_table_structure in Demonstration site (Sandbox / Snapshot) 5

Dump table structure.

1 call to _demo_dump_table_structure()
demo_dump_db in ./database_mysql_dump.inc
Dump active database.

File

./database_mysql_dump.inc, line 60

Code

function _demo_dump_table_structure($table) {
  $output = "\n";
  $output .= "--\n";
  $output .= "-- Table structure for table '{$table}'\n";
  $output .= "--\n\n";
  $data = db_fetch_array(db_query("SHOW CREATE TABLE %s", $table));
  $output .= preg_replace('/^CREATE TABLE/', 'CREATE TABLE IF NOT EXISTS', $data['Create Table']) . ";\n";
  return $output;
}