Home
/
phpMyAdmin Tutorials
/
phpMyAdmin Run MySQL Query Tutorial

phpMyAdmin Run MySQL Query Tutorial

This tutorial explains how to execute MySQL queries using the phpMyAdmin tool. There are two ways to do that with the phpMyAdmin interface.

Execute MySQL queries with the SQL tab

You can execute a MySQL query towards a given database by opening the database with phpMyAdmin and then clicking on the SQL tab. A new page will load, where you can provide the desired query. When ready click on Go to perform the execution.

The page will refresh and you will see the results from the query you provided.

Construct and execute MySQL queries with the Query tab

The other way to query a MySQL database with the phpMyAdmin tool is to use the Query tab. There you can define different search conditions, sort the results and query multiple tables.

The columns which will be included in the MySQL statement should be picked from the Column drop-down menus. Also, the Show checkbox should be selected for each column.

Through the Sort drop-down menu, you can visualize the result sorted in an ascending or descending order. With the Sort order drop-down, you can choose which column should appear wherein the results.

In the Criteria text field, enter the criteria according to which the search will be completed.

Additionally, you can use the Ins and the Del checkboxes to add or delete text rows for search conditions. The same can be performed through the Add/Delete Criteria Row drop-down menu.

In the Modify section, define the relations between the fields (whether they are connected through the AND or the OR logical operators).

You need to click on Update Query to complete the modifications.

Then you should select the tables used in the query from the Use Tables list.

To run the query click on Submit Query.

You can find more details about the MySQL syntax in the official MySQL Documentation.

Share This Article