In this assignment, you will build two pages that read from the chinook
Postgres database that you hosted on Heroku during class. You are welcome to use the same codebase that we worked on in class.
Listing Playists
Create playlists.php
and display all playlist names.
Each playlist should link to tracks.php?playlist=PLAYLIST_ID
, where PLAYLIST_ID
is replaced by the ID of the playlist.
Listing Tracks by Playist
Next, create tracks.php
. This page should display all tracks for the playlist
query string parameter. For each track, display the following information:
- Track name
- Album title
- Artist name
- Price
- Genre name
If there is no playlist
query string parameter, redirect back to playlists.php
or index.php
(assuming you are using the project that we created together in class).
If a playlist doesn't have any tracks, display "No tracks found for PLAYLIST NAME HERE>" where PLAYLIST NAME HERE
is the name of the playlist.
Other Requirements
- All queries should use the PDO class.
- You must use environment variables for the database credentials and not commit your
.env
file.
Deploy to Heroku
Deploy your assignment to Heroku. Create a README.md
file and add your Heroku link to it.
Submission
Send an email to Brighton and me with the URL to your GitHub repository with the subject: "ITP 405 - Assignment 1".