Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
So our next step in creating our database-driven application will be to define the database. So here we are in phpMyAdmin and we will go ahead and define a database. Now we have an existing database. If you are working with our example files you'll load that up. If not, just go ahead and feel free to create your own. We'll go about midway down the page and you'll see a dialog box that says Create new database. Now we're going to go ahead and type in the name of our database and we're going to go ahead and type in artist, and after we type in artist and that's artist singular and we would be using all lowercase, go ahead and click Create.
Now it has created our database for us and at this point it's just waiting for us to populate it. Now if we wanted to we could go ahead and populate this by hand, but we happened to have an existing database and we'll go ahead and populate it that way. Since we have existing database information we'll just import that information. So there are some navigation tabs at the top of the page and I am just going to go click on the Import link. This will bring up a new screen and it's asking us for the location of the text file that we're going to import and if we knew the location we could just type it in, but it's easier just to browse. So I am going to type Browse.
Right, so you're going to click on the Chapter 8 Dynamic Development Exercise Files and you'll notice that the artist _db.sql is right in there. That's the data we're going to add to our database. So we'll click Open, and it will go ahead and bring that information in. So to finish the import just scroll down, you may have scrolled down a little bit based on your screen resolution and click Go. It will give you a message that lets you know if the import has been successful and it looks like our import has been successful. So we're just going to verify that our information was successfully imported.
We have a drop-down menu on the left- hand side now that says Databases, so I am going to grab that pulldown menu and I want to choose the artist database. So we're looking inside of our artist database right now, and this may seem kind of confusing but we have a table named artists. So what we are looking at is a listing of all the tables in our database. We only have one table in this database, so it's a fairly simple database. And at this point we can go ahead and inspect these tables and see what's inside of them. Now may be attempted to go ahead and click the checkbox before you browse, but it's an odd sort of the interface thing if you check the box beside the table name before you browse it will un- check it. So I am just going to go right beside artists and click Browse. Again your screen resolution may force you to do this. we're going to scroll down a little bit and we get to inspect our table. So we can see there all our artists, so we have William and Josh, Joe, Jennifer, Greg, Debra, all the way down to Ben.
Now I just want to take a brief moment here to inspect the database and see what kind of information we're going to be dealing with. The first item in our table that we are going to be using is an artist id and you can see that is the fourth column over right here. Then we have artist's firstName and artist's lastName, a shortName, a tagLine and a bio, which contains a much longer description of the artist, and then we have image links to a small image, a large image and a caption for that larger image. So this is all information that was put together so that we could display this information in our application.
Now that we have our server environment set up and running and a database where application defined we're going to return to Dreamweaver and enable our site for dynamic development.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.