Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
So WordPress is powered by a MySQL database. This database stores all the posts, all the users, all the comments, the tags, the categories--everything you see in the WordPress environment. It can be really helpful to know the structure of this in your Plugin development. You can find this all at the Codex. There is a special page dedicated just to the database description, and you can see here, there's different versions. So the database is continually changing and evolving, which means when possible you want to use the functions created specifically to access the database instead of accessing the database directly.
If you do need to know the structure, you can download that schema at the Codex, and you can see it here. You can see we have a posts. We have a users; that's where the main data is stored. The options are stored in a separate file, and links are stored here as well. We also have some other data types that are stored. Some of the meta comments, these are basically used for custom fields, so wp_usermeta is used whenever you create a custom field for a user, just like postmeta is created as custom fields for posts.
Keep in mind that you wouldn't have to access wp_posts; you could use the wpdbpost property to get the name of that database. In case that should never change in the future, it would keep your code from breaking. If you want to look at your database directly, along with the MAMP installation, they have an install of phpMyAdmin. This will give you access to your database. You can see it listed here. Whatever name you gave it when you first start it up, you'll to see it. When you click on it, you'll be able to access the different tables, and from there you, can see the types of data that are in each table, and you're also able to go through and view what's in the fields.
You can browse the table itself, and you can also go in and run SQL on it, and do all kinds of other tests. So the built-in database stores all kinds of information that's useful when you're working in WordPress. This includes anything from users to pages to comments and links. Understanding the structure of the database might be helpful for plugin development, if you should need to access things directly. But be careful; there are many times when you can get this data and interact this data without actually having to access it directly using the built-in functions, and when that's the case, it's usually a best practice to do so.
Get unlimited access to all courses for just $25/month.Become a member