The stuff you have done so far is easier to do in PHPMyAdmin than by creating PHP pages because you only create a database once. Inserting data is normally done often and so it is usually best to write a page to do it for you. However, you can use PHPMyAdmin and sometimes that is easier:
- if necessary click on the database on the left and then choose firsttable
- click on the Insert tab at the top
- the first field in the form you now see is the primary key and you chose to auto-increment that one so leave it blank and it will be done for you
- type in:
- the CD name/title: Purpose
- the artist/group: Justin Bieber
- the price: 0.01 (no currency symbol)
- the record label/company: Virgin EMI
- and press Go
The new row has been inserted into the table but take a look at what is now on your screen. It is the SQL query which was used by PHPMyAdmin to insert the new data. Again it is the same sort of thing you used when you created PHP pages to insert SQL data.
To see the inserted data click on Browse at the top.
Add at least one more CD to firsttable. Think of any CD you know (if you don't know anything about such old-fashioned things find an example on the Web).
Now go to secondtable and insert some data into that as well. Add at least two tracks for each of the CDs in firsttable. For the first one that would be:
- leave the primary key trackID in secondtable empty as it is also auto-increment
- cdReference should be 1
- trackOrder would be 1 as this is the first track on the CD
- the track title is Mark My Words
The second track for that CD will have the same cdReference but the trackOrder will be 2.
The cdReference for each track needs to match the one for the CD in firsttable (so you will have at least two entries in secondtable with cdReference containing 1 and two containing 2 depending on which CD the tracks are on. The screen shot shows secondtable when you are finished (your third and fourth entries will probably be different as your taste in music is probably not as good as mine).