Overview of Database Tables
Joomla uses a database (normally run with the MySQL database program) to store all of the data for the site. The standard Joomla database for version 1.6 contains 33 tables. In this section, we will give a brief description of each table and its role in the program.
Note About Table Prefixes
When you install Joomla, you can select a prefix for the table names in the database. The default prefix is "jos_". When you see a table accessed inside the PHP code, you will normally see it with the generic prefix "#__". The "query()" method of the "JDatabaseMySQLi" class calls a method called "replacePrefix()" that replaces the generic prefix with the actual one from the "configuration.php" file.
For the purposes of this book, we will use the default "jos_" prefix for the table names (for example, "jos_content"). However, in the code they will also be shown with the "#__" prefix (for example, "#__content"). If you specify a different prefix when you install Joomla, in your database the tables will be named with that prefix.
Standard Joomla Tables
Table Name |
Description |
PHP Class |
jos_assets |
New table added for ACL in version 1.6. Includes a row for every component, Contains a row for every item that has ACL permissions. This includes a "Root Asset" for the global permissions, a row for every component, plus a row for every component category, and finally a row for every article. The "rules" column stores the group permissions in JSON format. This table is used whenever we check if a user is authorized to perform an action. |
JTableAsset |
jos_banners |
Contains a row for every banner defined in the site. |
none |
jos_banner_clients |
Contains a row for every banner client defined in the site. |
none |
jos_banner_tracks |
Contains a row for every banner track defined in the site. |
none |
jos_categories |
Contains a row for every category defined in the site. This includes article, banner, contact, newsfeed, and weblinks categories. |
JTableCategory |
jos_contact_details |
Contains a row for every contact defined in the site. |
none |
jos_content |
Contains a row for every article defined in the site. |
JTableContent |
jos_content_frontpage |
Contains a row for every article assigned to the featured blog menu item. |
none |
jos_content_rating |
Contains a row for every rated article in the site. |
none |
jos_core_log_searches |
Contains a row for every search term logged by the site. |
none |
jos_extensions |
Contains a row for every extension installed in the site. This includes component, library, module, plugin, template, language, and file extensions. |
JTableExtension |
jos_languages |
Contains a row for every language installed in the site. |
JTableLanguage |
jos_menu |
Contains a row for every front and back-end menu item defined for the site. |
JTableMenu |
jos_menu_types |
Contains a row for every front-end menu defined for the site. |
JTableMenuType |
jos_messages |
Contains a row for every private message sent in the site. |
none |
jos_messages_cfg |
Contains a row for every back-end user who sets a configuration in the Components → Messaging → My Settings option. |
none |
jos_modules |
Contains a row for every module defined in the system. A "client_id" column of "0" indicates it is a front end module, "1" indicates a back-end module. |
JTableModule |
jos_modules_menu |
Mapping table to show which modules are assigned to which menu items. The "menuid" column indicates which menu items the module is assigned to, as follows: "0" means assigned to all menu items; positive integer means assigned to this one menu item; and negative integer means assigned to all menu items except for this menu item. |
none |
jos_newsfeeds |
Contains a row for every newsfeed created in the site. |
none |
jos_redirect_links |
Contains a row for every redirect created in the site. |
none |
jos_schemas |
Contains a row for each extension that has made database changes during its installation, along with the latest installed version of the extension. |
none |
jos_session |
Contains a row for every active session for the site. |
JTableSession |
jos_template_styles |
Contains a row for every template style defined for the site. |
none |
jos_updates |
Contains a row for every available package to be installed. |
JTableUpdate |
jos_update_categories |
This table is used to categorize the updates. It is maintained automatically by Joomla. |
none |
jos_update_sites |
List of update sites. This comes from the update XML file for each extension. |
none |
jos_update_sites_extensions |
Mapping table that links jos_extensions with jos_updates. Contains a row for each combination of extension and update site where that extension can be updated. |
none |
jos_usergroups |
Contains a row for every user group defined for the site. |
JTableUsergroup |
jos_users |
Contains a row for every user defined for the site. |
JTableUser |
jos_user_profiles |
Contains a row for every combination of user id and profile field. This table is used if you have the User – Profile plugin enabled. |
none |
jos_user_usergroup_map |
Contains a row for every group that a user is a member of. |
none |
jos_viewlevels |
Contains a row for every View Level defined in the site. |
JTableViewlevel |
jos_weblinks |
Contains a row for every weblink defined in the site. |
none |
Figure 46: List of Joomla Database Tables