From the course: PHP with MySQL Essential Training: 1 The Basics
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Challenge: List pages
From the course: PHP with MySQL Essential Training: 1 The Basics
Challenge: List pages
(upbeat chiming music) - [Instructor] It's time for another challenge assignment. Your challenge this time is to take what we've learned in this chapter so that you're able to connect to the database, retrieve records from the pages table, and then use that data to make a list of the key page attributes using PHP. Let's go over the points you want to make sure that you hit. The first is that you want to use the database connection that we've already set up and you will remember we assigned it to a variable in initialize.php. Review that code, make sure that you understand it, and that you know how to use it. Once you have that, you'll be able to query the pages table for all records sorted by their position so that we can generate a list of the pages. And what's the right place for a list? Well, that's going to be in our pages directory inside index.php. You'll remember that we had some placeholder code in there to begin with. You can go ahead and remove that placeholder pages array…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.