Custom Database API – The Basic API Class

In the previous sections of this series, we have looked at reasons you should build a custom database API, we have discussed how to structure your data, and we have looked at how to create the database tables. Now it is time to build the basic API that we will use to actually interact with our database. This will involve writing an API class with all of the necessary methods for retrieving, inserting, updating, and deleting data.

Custom Database API – Creating the Tables

Once you have laid out the structure for your database table, it is time to create the actual tables. This is where it gets fun. When the tables are created, you can really begin building your API for interacting with the database and that’s when this whole project begins to truly take shape.

Retrieve Users Based on Meta Value

Just like the post meta system, WordPress has a powerful user meta system that allows developers to store additional “meta” information about the registered users in the database. This meta information can be just about anything you want it to be, and can serve a variety of purposes. At the time of writing this tutorial,…