数字化技能提升教程,数字化时代生存宝典

数字化百科 / 产品文档 / WordPress:Database Description/2.3

WordPress:Database Description/2.3

查看全部产品文档命名空间:WordPress

The following is an outline and description of the database tables created during the standard installation of WordPress at WordPress:Version 2.3.

Because WordPress interfaces with this database by itself, you as an end user, shouldn't have to worry much about its structure. If you're WordPress:Writing a Plugin, however, you may be interested in learning how to interface with the database directly. WordPress provides the wpdb Class to make this task easy.

= Table Overview =
This section is the overview of all the tables created during the WordPress standard installation. It is followed by specific information of what is in each table.

下面是在标准地安装2.3版本时,创建的数据库表格的大纲和描述。

因为WordPress自身与这个数据库向联系,你作为一名终端用户,不应该太多地担忧数据库的结构。 如果你正编写一个插件,你可能对怎样直接操作数据库,感兴趣。 WordPress提供了wpdb Class,使得操作数据库,这个任务变得简单。

= 表格总览=
这个部分是标准安装WordPress时,创建的表格的总览。 表格后面,有详细的信息,关于每个格是关于什么内容的。


WordPress 2.3 Tables (10)
Table Name || width="15%" | Description || width="15%" | Relevant Area(s) of WordPress User Interface
wp_comments]] || The comments within WordPress are stored in the wp_comments table. || Comments are created by readers as responses to posts. Comments are managed by administrator via WordPress:Administration Panels >> Manage >> Comments
wp_links]] || The wp_links holds information related to the links entered into the Blogroll Manager feature of WordPress. || WordPress:Administration Panels >> Blogroll >> Manage Blogroll
WordPress:Administration Panels >> Blogroll >> Add Links
WordPress:Administration Panels >> Blogroll >> Import Links
wp_options]] || The Options set under the Administration > Options panel are stored in the wp_options table. || WordPress:Administration Panels >> Options > > General
WordPress:Administration Panels >> Options > >Writing
WordPress:Administration Panels >> Options > >Reading
WordPress:Administration Panels >> Options > >Discussion
WordPress:Administration Panels >> Options > >Permalinks
WordPress:Administration Panels >> Options > >Miscellaneous
wp_postmeta]] || Each post features information called the meta data and it is stored in the wp_postmeta. Some tag plugins, and other plugins may add their own information to this table. || WordPress:Administration Panels >> Write >> Write a Post
wp_posts]] || The core of the WordPress data is the posts. It is stored in the wp_posts table. || WordPress:Administration Panels >> Write >> Write a Post
wp_terms]] || The categories for both posts and links and the tags for posts are found within the wp_terms table. || WordPress:Administration Panels >> Manage >> Categories
WordPress:Administration Panels >> Write >> Write Post
WordPress:Administration Panels >> Manage >> Posts >> Edit
wp_term_relationships]] || Posts are associated with categories and tags from the wp_terms table and this association is maintained in the wp_term_relationships table. The association of links to their respective categories are also kept in this table.|| WordPress:Administration Panels >> Manage >> Categories
WordPress:Administration Panels >> Write >> Write Post
WordPress:Administration Panels >> Manage >> Posts >> Edit
wp_term_taxonomy]] || This table describes the taxonomy (category, link, or tag) for the entries in the wp_terms table. || WordPress:Administration Panels >> Manage >> Categories
WordPress:Administration Panels >> Write >> Write Post
WordPress:Administration Panels >> Manage >> Posts >> Edit
wp_usermeta]] || Each user features information called the meta data and it is stored in wp_usermeta. || WordPress:Administration Panels >> Users
wp_users || The list of users is maintained in table wp_users. || WordPress:Administration Panels >> Users }


WordPress 2.3 表格 (10)
表格名 || width="15%" | 描述 || width="15%" | WordPress用户界面的相关区域
wp_comments]] || WordPress中的评论储存在wp_comments表格中。|| 评论是读者对文章的评价。评论是由管理员通过 管理面板管理的 >> 管理 >> 评论
wp_links]] || The wp_links 拥有输入在 链接管理器中的 链接的 相关信息。 || 管理面板 >> 友情链接 >> 管理友情链接
管理面板 >> 友情链接 >> 添加链接
管理面板 >> 友情链接 >> 导入链接
wp_options]] || 选项 设置在管理 > 选项 面板的下面,储存在 wp_options 表格中。 || 管理面板 >> 选项 > >
管理面板 >> 选项 > >
管理面板 >> 选项 > >阅读
管理面板 >> 选项 > >讨论
管理面板 >> 选项 > >Permalinks
管理面板 >> 选项 > >Miscellaneous
wp_postmeta]] || 每篇 文章 拥有称为meta data 的信息,而且这个信息储存在wp_postmeta。有的标签插件和其它的插件,可能添加信息到表格中。|| 管理面板 >> >> 写文章
wp_posts]] || WordPress数据的核心是 文章。文章储存在wp_posts表格中。 || 管理面板 >> >> 写文章
wp_terms]] || 文章和链接的类别是文章的标签,在 wp_terms 表格中。 || 管理面板 >> 管理 >> 类别
管理面板 >> >> 写文章
管理面板 >> 管理 >> 文章 >> 编辑
wp_term_relationships]] || 文章wp_terms 表格中的类别和标签相关,而且这种关联保存在wp_term_relationships表格中。 链接与各自类别的关联,保存在这个表格中。|| 管理面板 >> 管理 >> 类别
管理面板 >> >> 写文章
管理面板 >> 管理 >> 文章 >> 编辑
wp_term_taxonomy]] || 这个表格描述了wp_terms表格中的 (类别, 链接,或者标签) 的分类。|| 管理面板 >> 管理 >> 类别
管理面板 >> >> 写文章
管理面板 >> 管理 >> 文章 >> 编辑
wp_usermeta]] ||每个用户 拥有称为meta data 的信息,而且这个信息储存在wp_usermeta。 || 管理面板 >> [[WordPress:Administration_Panels#Users_-_Your_Blogging_Family|用户]
wp_users || 用户 列表储存在表格wp_users。|| 管理面板 >> 用户 }

=Table Details=
The following are the specific fields in each of the tables created during the standard WordPress installation.

= 表格详细信息=
这个部分是标准安装WordPress时,每个表格中创建的特别的栏。

Table: wp_comments

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20) unsigned|| ||PRI||NULL||auto_increment
int(11)|| ||IND||0||FK->wp_posts.ID
tinytext|| || || || 
varchar(100)|| || || || 
varchar(200)|| || || || 
varchar(100)|| || || || 
datetime|| || ||0000-00-00 00:00:00|| 
datetime|| || ||0000-00-00 00:00:00|| 
text|| || || || 
int(11)|| || ||0|| 
enum('0','1','spam')|| ||IND||1|| 
varchar(255)|| || || || 
varchar(20)|| || || || 
bigint(20)|| || ||0||FK->wp_comment.ID
bigint(20)|| || ||0||FK->wp_users.ID

Table: wp_links

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20)|| ||PRI||NULL||auto_increment
varchar(255)|| || || || 
varchar(255)|| || || || 
varchar(255)|| || || || 
varchar(25)|| || || || 
bigint(20)|| ||IND||0||FK->wp_categories.cat_ID
varchar(255)|| || || || 
enum('Y','N')|| ||IND||Y|| 
int(11)|| || ||1|| 
int(11)|| || ||0|| 
datetime|| || ||0000-00-00 00:00:00|| 
varchar(255)|| || || || 
mediumtext|| || || || 
varchar(255)|| || || || 

Table: wp_options

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20)|| ||PRI||NULL||auto_increment
int(11)|| ||PRI||0|| 
varchar(64)|| ||PRI&IND|| || 
enum('Y','N')|| || ||Y|| 
int(11)|| || ||1|| 
longtext|| || || ||
int(11)|| || ||20|| 
int(11)|| || ||8|| 
tinytext|| || || ||
int(11)|| || ||1|| 
enum('yes','no')|| || ||yes|| 

Table: wp_postmeta

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20)|| ||PRI||NULL||auto_increment
bigint(20)|| ||IND||0||FK->wp_posts.ID
varchar(255)||YES||IND||NULL|| 
longtext||YES|| ||NULL|| 

Table: wp_posts

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20) unsigned|| ||PRI||NULL||auto_increment
bigint(20)|| || ||0||FK->wp_users.ID
datetime|| || ||0000-00-00 00:00:00|| 
datetime|| || ||0000-00-00 00:00:00|| 
longtext|| || || || 
text|| || || || 
int(4)|| || ||0||FK->wp_categories.cat_ID
text|| || || || 
enum('publish','draft','private','static','object','attachment','inherit','future')|| ||IND||publish|| 
enum('open','closed','registered_only')|| || ||open|| 
enum('open','closed')|| || ||open|| 
varchar(20)|| || || || 
varchar(200)|| ||IND|| || 
text|| || || || 
text|| || || || 
datetime|| || ||0000-00-00 00:00:00|| 
datetime|| || ||0000-00-00 00:00:00|| 
text|| || || ||
bigint(20)|| || ||0||FK->wp_posts.ID
varchar(255)|| || || || 
int(11)|| || ||0|| 
varchar(20)|| || ||post|| 
varchar(100)|| || || || 
bigint(20)|| || ||0|| 

Table: wp_terms

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20)|| ||PRI|| ||auto_increment
varchar(55)|| || ||  || 
varchar(200)|| ||UNI IND|| || 
bigint(10)|| || ||0|| 

Table: wp_term_relationships

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20)|| ||PRI Pt1||0|| 
bigint(20)|| ||PRI Pt2, IND||0||FK->wp_term_taxonomy.term_taxonomy_id

Table: wp_term_taxonomy

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20)|| ||PRI|| ||auto_increment
bigint(20)|| ||UNI IND Pt1||0 ||FK->wp_terms.term_id
varchar(32)|| ||UNI IND Pt2|| || 
longtext|| || || || 
bigint(20)|| || ||0|| 
bigint(20)|| || ||0|| 

Table: wp_usermeta

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20)|| ||PRI||NULL||auto_increment
bigint(20)|| || ||'0'||FK->wp_users.ID
varchar(255)|| ||IND||NULL|| 
longtext|| ||IND||NULL|| 

Table: wp_users

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20) unsigned|| ||PRI||NULL||auto_increment
varchar(60)|| ||UNI & IND|| || 
varchar(64)|| || || || 
varchar(50)|| || || || 
varchar(100)|| || || || 
varchar(100)|| || || || 
datetime|| || ||0000-00-00 00:00:00|| 
int(2) unsigned|| || ||0|| 
varchar(60)|| || || ||
int(11)|| || ||0|| 
varchar(250)|| || ||  || 

表格: wp_comments

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20) unsigned|| ||PRI||NULL||auto_increment
int(11)|| ||IND||0||FK->wp_posts.ID
tinytext|| || || || 
varchar(100)|| || || || 
varchar(200)|| || || || 
varchar(100)|| || || || 
datetime|| || ||0000-00-00 00:00:00|| 
datetime|| || ||0000-00-00 00:00:00|| 
text|| || || || 
int(11)|| || ||0|| 
enum('0','1','spam')|| ||IND||1|| 
varchar(255)|| || || || 
varchar(20)|| || || || 
bigint(20)|| || ||0||FK->wp_comment.ID
bigint(20)|| || ||0||FK->wp_users.ID

表格: wp_links

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20)|| ||PRI||NULL||auto_increment
varchar(255)|| || || || 
varchar(255)|| || || || 
varchar(255)|| || || || 
varchar(25)|| || || || 
bigint(20)|| ||IND||0||FK->wp_categories.cat_ID
varchar(255)|| || || || 
enum('Y','N')|| ||IND||Y|| 
int(11)|| || ||1|| 
int(11)|| || ||0|| 
datetime|| || ||0000-00-00 00:00:00|| 
varchar(255)|| || || || 
mediumtext|| || || || 
varchar(255)|| || || || 

表格: wp_options

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20)|| ||PRI||NULL||auto_increment
int(11)|| ||PRI||0|| 
varchar(64)|| ||PRI&IND|| || 
enum('Y','N')|| || ||Y|| 
int(11)|| || ||1|| 
longtext|| || || ||
int(11)|| || ||20|| 
int(11)|| || ||8|| 
tinytext|| || || ||
int(11)|| || ||1|| 
enum('yes','no')|| || ||yes|| 

表格: wp_postmeta

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20)|| ||PRI||NULL||auto_increment
bigint(20)|| ||IND||0||FK->wp_posts.ID
varchar(255)||YES||IND||NULL|| 
longtext||YES|| ||NULL|| 

表格: wp_posts

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20) unsigned|| ||PRI||NULL||auto_increment
bigint(20)|| || ||0||FK->wp_users.ID
datetime|| || ||0000-00-00 00:00:00|| 
datetime|| || ||0000-00-00 00:00:00|| 
longtext|| || || || 
text|| || || || 
int(4)|| || ||0||FK->wp_categories.cat_ID
text|| || || || 
enum('publish','draft','private','static','object','attachment','inherit','future')|| ||IND||publish|| 
enum('open','closed','registered_only')|| || ||open|| 
enum('open','closed')|| || ||open|| 
varchar(20)|| || || || 
varchar(200)|| ||IND|| || 
text|| || || || 
text|| || || || 
datetime|| || ||0000-00-00 00:00:00|| 
datetime|| || ||0000-00-00 00:00:00|| 
text|| || || ||
bigint(20)|| || ||0||FK->wp_posts.ID
varchar(255)|| || || || 
int(11)|| || ||0|| 
varchar(20)|| || ||post|| 
varchar(100)|| || || || 
bigint(20)|| || ||0|| 

表格: wp_terms

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20)|| ||PRI|| ||auto_increment
varchar(55)|| || ||  || 
varchar(200)|| ||UNI IND|| || 
bigint(10)|| || ||0|| 

表格: wp_term_relationships

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20)|| ||PRI Pt1||0|| 
bigint(20)|| ||PRI Pt2, IND||0||FK->wp_term_taxonomy.term_taxonomy_id

表格: wp_term_taxonomy

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20)|| ||PRI|| ||auto_increment
bigint(20)|| ||UNI IND Pt1||0 ||FK->wp_terms.term_id
varchar(32)|| ||UNI IND Pt2|| || 
longtext|| || || || 
bigint(20)|| || ||0|| 
bigint(20)|| || ||0|| 

表格: wp_usermeta

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20)|| ||PRI||NULL||auto_increment
bigint(20)|| || ||'0'||FK->wp_users.ID
varchar(255)|| ||IND||NULL|| 
longtext|| ||IND||NULL|| 

表格: wp_users

Field!!Type!!Null!!Key!!Default!!Extra


bigint(20) unsigned|| ||PRI||NULL||auto_increment
varchar(60)|| ||UNI & IND|| || 
varchar(64)|| || || || 
varchar(50)|| || || || 
varchar(100)|| || || || 
varchar(100)|| || || || 
datetime|| || ||0000-00-00 00:00:00|| 
int(2) unsigned|| || ||0|| 
varchar(60)|| || || ||
int(11)|| || ||0|| 
varchar(250)|| || ||  || 

= Resources =

= 资源 =


  • [http://wpbits.wordpress.com/2007/08/08/a-look-inside-the-wordpress-database/查看WordPress数据库内部] - Leonid Mamchenkov深入讨论WordPress数据库表格。