- Becoming Familiar with Databases in PhpMyAdmin
- Running SQL Queries on a Database with PhpMyAdmin
- Searching Through a Database with PhpMyAdmin
- Creating Tables in a Database with phpMyAdmin
- Importing Databases and Tables with PhpMyAdmin
- Exporting Databases and Tables with PhpMyAdmin
- Renaming Database Tables with PhpMyAdmin
- Copying a Database Table with phpMyAdmin
- Inserting Fields into Database Tables with phpMyAdmin
- Modifying Fields in Database Tables with phpMyAdmin
- Deleting Fields from Database Tables with phpMyAdmin
Using PhpMyAdmin to search for records and information in your database can quickly help you get the information you need without having to run advanced search queries. This tutorial assumes you have already logged in to PhpMyAdmin, and shows how to search by keyword and for a range of records.
First, from the main PhpMyAdmin screen, we can click on the database name from the left navigation menu. In this example, we selected the lwtest_wpdb database which is a test WordPress database taken from a live site.
We then clicked on the Search tab at the top of the PhpMyAdmin page
As we can see from the image below, this is a general keyword search. We will put “test” in the search box to show the basic functionality, but the other options under “Find” can also show records with multiple search terms. This will search for the exact string that is entered, or we can even use regular expressions to search. Using the table box seen below, we can select the tables we want to search through, or just click on “Select all” to search through all the tables in the database. Then we can click on the Go button in the lower right of the page to start the search.
The results page shows us the number of matches that were in each table we searched through. For the tables that had the search, term we can click on Browse to view the results. We will click on Browse for the wp_options table, and see the 4 matches our search returned.
The page below shows the actual query that PhpMyAdmin used to get the results. If we wanted to run the query manually or tweak the search further we can copy the query from there. After that, it shows the table with each record that had “test” in it. One important thing to note, the query matched “test” when it was found in both uppercase, lowercase, and the word “Testing”. Our query even listed the two results found in the email address and it still only counted that result as one record.
Next, we can search for a range of data by using the table’s Search tab. We then click on the table name we want to search from the databases in the left-hand navigation, in this case, we will search the wp_comments table. We then clicked on the Search tab at the top of this page.
The Search tab is different from the database level search as it shows the table columns, what type of data they store, and provides the option to search using different operators.
These options can help us locate a range of data. If we review the search options for the comment_ID field, we can select the < (less than) operator and enter a value of 400. Then we will click on the Go button in the bottom right side to begin our search.
Our results page indicate that 267 records were matched when searching for a comment_ID of less than 400. We can now review those records, Edit, Copy, or Delete the records we want, or modify the search again and continue searching!
From the PhpMyAdmin interface we can quickly search through databases for specific data and ranges easily via a browser window. This is much easier compared to running queries manually via the command line.
Additionally, the search results provided allow for easy editing, copying, and removal as well. PhpMyAdmin also displays the queries it uses to perform the search actions. This can also be used as a learning tool or reference to write or create a new query that can be used at a later date.