4.2. Looking at the Data in a Database

After data has been entered into a database, you might want to browse through the data to see whether the entered data looks correct or to get an idea of what type of data is in the database. You can also browse the data to determine simple information about the database, such as how many records it contains.

4.2.1. Browsing the data with SQL queries

You can see all the data in a table with the following query:

SELECT * FROM tablename

This query gets all the data from a table. You can find out how many records are in the table and get a general idea of the data by browsing the output.

You can see exactly how many records are in a table with the following query:

SELECT COUNT(*) FROM tablename

This query outputs the number of records contained in the table.

4.2.2. Browsing the data with phpMyAdmin

You can look at all the data in a table with phpMyAdmin as follows:

  1. Open the Table page by clicking the table name in the left panel.

    If a database isn't selected, click the database name or select the database from the Database drop-down list.

    The Table page displays a list of the fields that are in the table, along with their definitions.

  2. Select the check box in front of the field name for all the fields that you want to browse.

    You can select all the fields at once by clicking the Check All link below the list of fields.

  3. Click the Browse icon.

    The ...

Get PHP & MySQL® Web Development All-in-One Desk Reference for Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.