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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xoops.gitbook.io/xmf-cookbook/reference/database/tables/table-operations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
