Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Once you've defined a database structure, you can add data to the database through phpMyAdmin. For this demonstration, I'll use the database structure that I've already created in a previous video. The name of the database is mydatabase. From the homepage of phpMyAdmin, I'll click into the database. The database has a single table, named people. Some of the icons will be disabled. The Browse and Search icons are both disabled currently, because the table doesn't have any data.
To insert some data, click the Insert link, the fourth icon from the left. You're taken to a screen where you can insert multiple rows. I'm going to add data for the firstName and lastName columns. I won't add data for the Id column, because that's an auto incrementing primary key. I'll click into the firstName, and type a value of Davey, and the lastName will be Jones. Then I can click Go immediately, or I can click down into fields in the second data entry form and insert multiple rows.
For the second row, I'll set the values as Melissa, Smith. Notice that as I type values into these fields, the Ignore check box was automatically deselected. To insert both rows at the same time, click the Go button. By default, you'll Go back to the previous page. But if you have more data to enter, you can instead choose Insert another new row. I'll leave these settings at the defaults and click Go. The resulting SQL statement that adds the data to the database is listed here.
I can browse the table by clicking the Browse icon in the Action column. I'll see that my data was successfully added to the table. The auto incrementing primary key column personId has values of 1 and 2, the next available values when I inserted the data. The nature of a primary key column is that its data should uniquely identify each row, and should be meaningless, meaning that the user shouldn't care about what the primary key is. So you can add as much data to your MySQL database tables as you need to through phpMyAdmin.
If you want to edit the table, you can go back to the Table link, which you'll find up at the top of the screen. From there, you can edit, or you can delete individual records, or you can select multiple records, and edit or delete them from there. I'm not going to use this particular database and database table in the rest of the video series for the exercises; instead, I'll be using a database table that's defined in an SQL Script. I'll show you how to import that script through phpMyAdmin in the next video.
Get unlimited access to all courses for just $25/month.Become a member