# Database structure

{% hint style="danger" %}
**Please note:** This page is under construction and has not been finished yet.
{% endhint %}

## Introduction

### Best practices

* **Do not modify the core database structure**

:thumbsup: Use your own tables (for example by [creating a plugin](/plugin-development/introduction.md)) if you want to work with additional data in the database. &#x20;

* **Do not (ab)use database tables and fields for other purposes**&#x20;

:thumbsup: Stick to purposes [defined in the database tables](/getting-started/database-structure.md#database-tables-overview) overview, or create your own database tables

### Database prefix

The default database table prefix is `e107_` and can be customized by the user during the installation of e107. The prefix that is used on an installation can always be found in the `e107_config.php` file.&#x20;

There are several ways the database prefix is used:

1. **Recommended:** It is strongly recommend to make use of the [database methods](/classes-and-methods/database.md#database-methods). Using these methods, the database table prefix is processed automatically. <br>
2. By using the `#` sign, one can automatically refer to the database prefix. This is generally used when using the[ e107::getDB()->gen()](/classes-and-methods/database.md#gen) method, to manually construct an SQL query. <br>
3. In rare cases, you may reference the `MPREFIX` constant. Its use is deprecated and **not** encouraged.&#x20;

## Database tables overview&#x20;

{% hint style="info" %}
TODO: Finish table below.&#x20;
{% endhint %}

The following table provides an overview of all database tables in a clean e107 installation, with their respective purposes.&#x20;

| Table name         | Description                                                                                                                                                                    |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| admin\_log         |                                                                                                                                                                                |
| audit\_log         |                                                                                                                                                                                |
| banlist            |                                                                                                                                                                                |
| comments           |                                                                                                                                                                                |
| core               |                                                                                                                                                                                |
| core\_media        |                                                                                                                                                                                |
| core\_media\_cat   |                                                                                                                                                                                |
| cron               |                                                                                                                                                                                |
| dblog              |                                                                                                                                                                                |
| generic            | <p>Table for generic purposes. Generally used to store temporary date. Currently also used by welcome message. <br><em>Developers are discouraged to use this table!</em> </p> |
| links              |                                                                                                                                                                                |
| mail\_recipients   |                                                                                                                                                                                |
| mail\_content      |                                                                                                                                                                                |
| menus              |                                                                                                                                                                                |
| news               |                                                                                                                                                                                |
| news\_category     |                                                                                                                                                                                |
| online             |                                                                                                                                                                                |
| page               |                                                                                                                                                                                |
| page\_chapters     |                                                                                                                                                                                |
| plugin             |                                                                                                                                                                                |
| rate               |                                                                                                                                                                                |
| submitnews         |                                                                                                                                                                                |
| tmp                |                                                                                                                                                                                |
| upload             |                                                                                                                                                                                |
| user               |                                                                                                                                                                                |
| userclass\_classes |                                                                                                                                                                                |
| user\_extended     |                                                                                                                                                                                |
|                    |                                                                                                                                                                                |


---

# 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://devguide.e107.org/getting-started/database-structure.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.
