More than half of what matters about a WordPress site is stored in its (typically MySQL) database. Why? Because WordPress stores all its “content” in the database. For most people, that makes it even more important (and harder to replace) than their plugins and themes, and possibly even media files.
In the simplest terms possible
$wpdb
is how the database is accessed 99% of the time on a WordPress site. It’s WordPress’s database interacting agent.
In the simplest terms possible $wpdb
is how the database is accessed 99% of the time on a WordPress site. It’s WordPress’s database interacting object. And it’s quite good, rather useful, and more than a bit interesting. It’s also not nearly as necessary to understand as a new developer might expect. I rarely use it outside of a small number of cases where it’s worthwhile to make and maintain my own database tables in a plugin. For most of my data creation and fetching needs, WordPress offers other functions which are a great deal easier.
So our goal is to get into a bit more detail about $wpdb
is and some of its capabilities, and then we’ll answer the more important issue: when you should and shouldn’t use it.
Understanding the Basics of Database Interactions in PHP
SQL stands for “structured query language” and its the general syntax that people use to put data into and retrieve data from relational databases like MySQL.
Nice post. Thanks for sharing this.
[…] What $wpdb Is, and Why I Try Not To Use It – So our goal is to get into a bit more detail about $wpdb is and some of its capabilities, and then we’ll answer the more important issue: when you should and shouldn’t use it. […]