> For the complete documentation index, see [llms.txt](https://xoops.gitbook.io/xmf-cookbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xoops.gitbook.io/xmf-cookbook/reference/database/tables/table-operations.md).

# 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().
