Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Challenge1:08 with Alena Holligan
Ready for a challenge? You've learned a lot about PHP and databases so far. Functions, Queries, Conditional Statements and Loops. In fact, you've learned enough to pull the genres for the form dropdown from the database. For this challenge, I want you to use the database for the genre dropdown instead of hard coding it.
Refresher on Adding People and Roles
Challenge: Use the database for the genre dropdown
- Pull all the genres from the database
- sorted alphabetically
- grouped by category.
- Loop through those results
- Create the HTML for the genre dropdown.
- Include HTML to select the genre that the user submitted.
You've learned a lot about PHP and databases so far. 0:00 Functions queries, conditional statements and loops. 0:03 In fact, you've learned enough to pull the genres for 0:08 the form drop down from the database. 0:11 For this challenge, I want you to use the database for the genres drop down. 0:13 Instead of hard coding it, this will require several things. 0:18 First, you'll need to pull all the genres from the database, sorted alphabetically, 0:22 and grouped by category. 0:27 Second, you'll need to loop through these results and 0:29 create the HTML for the genre's dropdown. 0:32 Third, you'll need to make sure that the HTML includes an optional selection for 0:36 the genre that the user posted to the form. 0:41 Remember, comments are a great way to start. 0:45 They help you to organize what goes where and 0:47 to make sure you accomplish all the requirements. 0:50 If you're not sure where to start, I've added a link in the teacher's notes. 0:53 To take another look at where we pulled people and 0:57 rolls for the item details page. 1:00 In the next video, I'll show you how I solve this challenge. 1:03 Good luck. 1:07
You need to sign up for Treehouse in order to download course files.Sign up