Now that you have set up the structure of your MySql database table, it's time to add a few records.
With phpMyAdmin still open, click the Insert tab at the top, three to the right of the Structures tab you're on now. You should see a screen like this one:
All the columns we set up are there, on the left. To add a new row, just type something into the Value text boxes. For the first record, add the following:
Your Insert tab should look like this:
Notice that the ID Value is left blank. MySql will take care of adding an auto increment number for us. The photo file name is just 1.png. You'll be downloading some photos for this project soon and you'll see they are all numbered 1, 2, 3, etc. If you want to use your own photos, you type the file name here, replacing 1.png with whatever your photo is called.
Click the GO button at the bottom to add a new row to your table. A new screen appears. This one:
The green area at the top is telling you that 1 row has been inserted. The area at the bottom is the SQL query for what you have just done. It's this:
INSERT INTO `tbl_employees` (`ID`, `First_Name`, `Family_Name`, `Job_Title`, `Photo`) VALUES (NULL, 'David', 'Khan', 'Programmer', '1.png');
If you want, rather than going back to the Insert tab and entering a second record, you can do it here. Just change the values to something else. So where we have David, Khan, Programmer, 1.png. You could change these to something else. Click the INSERT button below and you'll have a second record. Or if you've made a spelling mistake, you could correct it here and click UPDATE. When we do our database programming later, we'll be constructing a SQL query like the one above.
However, click back on the Insert tab as it's easier to insert new record from there. Add the following record:
Job_Title: Systems Analyst
Click Go to add it to your table.
Come back to insert and add a third record:
Add a fourth record:
Job_Title: IT Manager
To see all four of your new records, click on the Browse tab at the top:
And that's it! We now have a database we can use in our Python code.
In the next lesson, we'll design the form that's going to be used for data entry.