Tutorial: Running MySQL Queries in PhpMyAdmin

James Munford Help Leave a Comment

Tutorial: Running MySQL Queries in PhpMyAdmin

In the enxt paragraphs, we’ll go through how to construct and run a MySQL query in PhpMyAdmin.

Depending on your personnal level of knowledge, you could have other ways of doing the same task.

Option 1 SQL tab

This one is for advanced users. There you should write in the entire SQL query  and click on the Go button to execute it.

 

Option 2 Use the Query tab

This mode allow you to have some help to build the query visually

so with this mode, you can define different search conditions, sort and filter the results and query multiple tables at the same time!

You should select the tables used in the query from the Use Tables list. The fields which will be included in the SELECT MySQL statement should be picked from the Field drop-down menus. The Show check box should be selected.

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

Through the Sort drop-down menu you can visualize the result sorted in an ascending or a descending order.

The text window located below allows you do add extra search conditions.

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

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

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

To run the query click on the Submit Query button.

The query which we have included in our example is:

SELECT `AT_admins` . * FROM AT_admins WHERE (`AT_admins`.`login` LIKE “a%”);

It shows all the records from the AT_admins table for which the login field starts with “a”.

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

Leave a Reply

Your email address will not be published. Required fields are marked *