Wordpress database and that wpdb Class
To collate the following information network of non-original
The following are wp-2.0.5 version of the database structure of (ER diagram). Here only lists the primary key and foreign key. Diamond-shaped figure that 1: n relationship, as part of a white, black as part of the n.
Wordpress A total of 10 tables, divided into four categories according to function.
- user: user information, including wp_users table and wp_usermeta table.
- post: The article reviews and information, including wp_posts, wp_postmeta, wp_comments, wp_post2cat, as well as five wp_categories table.
- link: links, including wp_links table and wp_linkcategories table.
- option: setting the overall situation, including wp_options table.
Table of naming is very interesting. Sum up the basic rules are as follows:
- To preserve the basic properties of the object, named wp_objects, the use of the plural (for example, wp_posts, wp_comments);
- Save the expansion of the object attributes, named wp_objectmeta, the use of the singular (for example, wp_postmeta, wp_usermeta);
- Many-to-many relationship, named wp_a2b, which were b and a many-to-many relationship between the two ends of the object's name abbreviation (for example, wp_post2cat).
WPDB category
http://codex.wordpress.org.cn/Function_Reference/wpdb_Class
http://codex.wordpress.org/Function_Reference/wpdb_Class
Database description
http://codex.wordpress.org/Database_Description # Table_Overview
wp_categories: for the preservation of classified information related to the table. 5, including the field are:
- cat_ID - each unique ID number classifications for a bigint (20) value, and with additional properties auto_increment.
- cat_name - a classification name for a varchar (55) value.
- category_nicename - the classification assigned to a user-friendly names to remember, that is, the so-called slug, this is a varchar (200) value.
- category_description - a detailed description of the classification, longtext-value.
- category_parent - the higher the classification categories, as a int (4) value, corresponding to the current table is the cat_ID, that is, wp_categories.cat_ID. No higher level classification, the value is 0.












































