What is a database query
A database query is an inquiry or a request to access the data and perform actions such as creating, updating, deleting, manipulating, and viewing the data. Depending on how the query is entered, database queries are also used for collecting general or specific information.
Management of databases is done with a specific language. One of the widely used languages is SQL (Structured Query Language). In order to query a database, a database system such as MySQL is used.
Running a query on php MyAdmin
To run a query, you will need to connect to your database. Once connected, you will see the live database to the left of the dashboard.
To run a query on php MyAdmin:
- Click on the live_nameofyourdatabase to expand
To the right of the dashboard, you will see all the tables of your live website.
- At the top of the dashboard, click on SQL to make a query
- Type:
SELECT * FROM wp_(the name of the table you want)
Important:
Please make sure that the entered query has correct spacing and contains the table name for which you want to run the query.
When you have entered the query:
- Click Go, located at the bottom right of the dashboard
Important:
Always make a backup of your entire website when running an update or insert query.
Staging websites have a different database with different credentials. If you would like to run queries on a staging site, make sure to switch to the staging environment, then follow the above steps.