smf_db_table_sql

Description

Gets the appropriate "CREATE" statement for the specified table

Syntax

string smf_db_table_sql (string $tableName)



Parameter $tableName

Expected type: String
Description: The name of the table



Return value

Expected type: Escaped String
Description: $schema_create - a formatted SQL string for re-creating the table in its current state


Notes

  • Used when creating backup files
  • Adds DROP TABLE IF EXISTS to the beginning of the statement
  • Adds NOT NULL where appropriate
  • Escapes default values if needed
  • Also appends any extra information, such as AUTO_INCREMENT, ENGINE / TYPE and table comments
  • Returns a formatted SQL string
Advertisement: