This course will be retired on June 1, 2025.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
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 upRelated 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