Assignment 1

In this assignment, you will build two pages that read from the chinook Postgres database that you hosted on Heroku during class.

Listing Playists

Create playlists.php and display all playlist names ordered alphabetically.

Each playlist should link to tracks.php?playlist=PLAYLIST_ID, where PLAYLIST_ID is replaced by the ID of the playlist.

Listing Tracks for a Playist

Next, create tracks.php. This page should display all tracks for the playlist query string parameter. For each track, display the following information in an HTML table:

  • Track name
  • Album title
  • Artist name
  • Price
  • Genre name

The tracks should be sorted by the track name.

If there is no playlist query string parameter, redirect back to playlists.php.

If a playlist doesn't have any tracks, display "No tracks found for the PLAYLIST NAME HERE playlist." where PLAYLIST NAME HERE is the name of the playlist.

Other Requirements

  • All queries should use the PDO class.
  • Use parameter binding for any untrusted data, like query string parameters.

GitHub Classroom Submission

https://classroom.github.com/a/8Admdh2c

Please read the section on Git, GitHub, and GitHub Classroom on the class welcome page if you need to refresh yourself.