Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
We’ll take the associative array created from the results of our database query and use it to populate our library. We’ll talk about how separation of concerns allows us to swap out the data our site is using, without having to change much code.
Another Way to Prove Database Usage
If you would like another way to test that your content is actually being pulled from the database, comment out the $catalog = $results
line.
Links
Example Code
$catalog = $results->fetchAll(PDO::FETCH_ASSOC);
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Joy Manuel
6,464 Points0 Answers
-
PLUS
Logan Fox
Courses Plus Student 3,379 Points5 Answers
-
jlampstack
23,932 Points2 Answers
-
Jonas Timas
10,894 PointsHello, Your code given at the start of lesson isn't working, there are error connecting to database. I can't code.
Posted by Jonas TimasJonas Timas
10,894 Points0 Answers
-
Daniel Schroeder
13,859 Points1 Answer
-
Brendan Jackson
5,246 Points8 Answers
-
Mike Hansen
Python Web Development Techdegree Student 3,419 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up