Movie Mayhem

Objective

For this assignment, you will demonstrate your understanding of PHP, MySQL, and PHP Data Objects to create a simple Movie Database site based on the Movie Mayhem database.

Project Setup

1. Clone the Repository

Clone the repository from GitHub and use the provided file to complete the assignment.

2. Import the Movie Mayhem Database

To import the database, using phpMyAdmin, complete the following instructions.

  1. Open phpMyAdmin at http://phpmyadmin.test (macOS) or http://localhost/phpmyadmin (Windows)
  2. Log in to phpMyAdmin using the root username and password
  3. From the phpMyAdmin homepage, click on the "Import" tab found at the top of the page.
  4. Under the "File to import" section, click the "Choose File" button. Choose the movie_mayhem.sql file found in this repository.
  5. Click the "Go" button found at the bottom of the page.
  6. Once the importing has been completed, click on the movie_mayhem database, which should appear in the list on the left side of the page.
  7. With the movie_mayhem database selected, click on the "SQL" tab at the top of the page. From this page, you can execute custom SQL commands.

3. Review the provided template site

The starter files include several HTML files, which serve as a template for the project include the movies gallery (index.html), the movie details page (movie.html), the new movie form (new.html), and the edit movie form (edit.html). A stylesheet (style.css) is also included.

Requirements

1. Display all the movies

On the site's homepage, display all the movies in the movies table of the movie_mayhem database. The movies should be displayed using the template as a guide, with only the movie title should be displayed. Clicking on a movie will take the user to that movie's details page.

Movie Mayhem Site homepage

On the site's homepage, the search box should allow the user to filter the movies. Any movie title that contains the search query should be displayed.

3. Show a movie's details

Clicking on any movie should open the details page for that movie, which will display all the details of the movie, including the movie's director, year, and genre. Use the template as a guide.

The edit button should take the user to the edit movie form.

Movie Mayhem Site movie details page

4. Add a movie

Clicking on the New Movie link takes the user to the New Movie form. The user should be able to fill out the form to add a new movie to the database.

Movie Mayhem Site new movie page

5. Edit a movie

When the user arrives on the edit movie page, the form should be pre-populated with the movie's details. The user should be able to edit any of the information and click the Update Movie button. This should cause the movie's details to be updated in the database, and the user should be taken back to the movie's details page.

The edit movie page should also contain a delete form.

Movie Mayhem Site edit movie page

6. Delete a movie

When the user submits the delete movie form, the form should delete the selected movie and return the user to the movies page.

Solution

Movie Mayhem Site video series