Working with your Database
Behind every great Basic+/Managed Mennonite.net website is WordPress, a Content Management System that makes it easy to bring text and ideas to life. Under the hood, WordPress uses a database to store and work with the information that it has to handle. Mennonite.net offers the ability to interact with the database directly, if the need arises.
This is the WordPress dashboard, the starting point for everything that has to do with your website. In the bottom right, you’ll find an ARI Adminer option.
Now that you’ve selected ARI Adminer, you have the option to either run Adminer in a modal window or a new window. Personally, I prefer running in a new window, so you can easily flip back and forth between the WordPress dashboard and the Adminer page.
This is where the magic happens! In this tutorial, we’ll go through the basic Adminer functions.
Databases are comprised of tables, of which one store relevant information. Adminer allows us to take a look at whichever table we wish.
Initially, after clicking on a table, it will show us the different columns in the table, and what they store. We can click on “Select data”, which will show us the data entries; you’ll notice that they coincide with the structure listed in “Show structure”.
By itself, this isn’t too powerful. Adminer, however, allows us to run SQL commands (or, “queries”), which allow us to work on the database in a more rigorous fashion.
This is the SQL command page. Mennonite.net backs up data on a daily basis, but nevertheless, always be careful! Great power comes with great responsibility.
This command, ideally, should show the post author and the post content for all posts that were authored by the author with ID 2. This is just one example of all the powerful things you can do with SQL (Structured Query Language).
It does just that! Adminer also has other features, which can all be done from the SQL command box. The most important ones are found on the left panel; Import, Export, and Create Table.
Export allows us to export all the data from the database into the desired output format. We can select the output type, the format of the file, which tables, and so on.
We can also work directly with creating tables and entries.
In this example, I’ll create a table which stores ID (an arbitrary number), the name, and the role of employees at Mennonite.net.
After hitting save, we’re given our new table. We can then proceed to “New item”.
After entering some text that works with the given data types, we can then hit Save and insert next.
When satisfied with the amount of entries in the table, we can then hit Save.
Using Adminer, we’ve created a table and added some entries to it. Adminer allows for full control over your database.
Working with databases is a very involved task; if you’re unsure of anything while working on your website, let us know at firstname.lastname@example.org.