XMF Cookbook
  • Introduction
  • XMF Cookbook
  • Basic Ingredients
    • Namespaces
    • Autoloading
    • Debugging
    • Forward Compatibility
  • Recipes
    • Introducing Module Helpers
    • Using the Permission Helper
      • Checking Permissions
      • Managing Item Permissions
    • Using the Session Helper
    • Using JSON Web Tokens
    • Altering Database Tables
    • Migrating a Module's Database
    • Loading Initial Data
    • Module Admin Pages
      • Hide and Seek with Icons
      • Standard Admin Pages
    • Manage Metadata
    • Highlighting Content
  • Reference
    • Assert
      • Assertions
    • Database
      • Migrate
      • TableLoad
      • Tables
        • Getting Started
        • Table Operations
        • Working with Columns
        • Working with Indexes
        • Changing Table Data
        • Interacting with the Work Queue
        • Error Info and Debugging
    • Debug
    • FilterInput
    • Highlighter
    • IPAddress
    • Jwt
      • JsonWebToken
      • KeyFactory
      • TokenFactory
      • TokenReader
    • Key
      • ArrayStorage
      • Basic
      • FileStorage
      • KeyAbstract
      • StorageInterface
    • Language
    • Metagen
      • Extracting Data
      • Applying Data
    • Module
      • Admin
      • Helper
      • Helper
        • AbstractHelper
        • Cache
        • GenericHelper
        • Permission
        • Session
    • ProxyCheck
    • Random
    • Request
    • StopWords
    • Uuid
    • Yaml
  • Credits
  • License:
  • Table of Content
Powered by GitBook
On this page
  • renameTable($table, $newName)
  • setTableOptions($table, $options)
  • dropTable($table)
  • copyTable($table, $newTable, $withData)
  1. Reference
  2. Database
  3. Tables

Table Operations

renameTable($table, $newName)

Queue instruction needed to rename a table named $table to $newName to the work queue.

Returns true on success, or false on error. Additional information may be available using getLastError() and getLastErrNo().

setTableOptions($table, $options)

Queue instruction needed to alter the table named $table with attributes specified in $options to the work queue.

An example of $options is "ENGINE=MyISAM DEFAULT CHARSET=utf8").

Returns true on success, or false on error. Additional information may be available using getLastError() and getLastErrNo().

dropTable($table)

Queue instruction needed to drop the table named $table to the work queue.

Returns true on success, or false on error. Additional information may be available using getLastError() and getLastErrNo().

copyTable($table, $newTable, $withData)

Loads schema for a table named $table from database, and adds a new table named $newTable with that same schema to the queue.

If $withData is specified as true, the table will be copied with data, otherwise only the structure will be duplicated.

Returns true on success, or false on error. Additional information may be available using getLastError() and getLastErrNo().

PreviousGetting StartedNextWorking with Columns

Last updated 6 years ago