Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

INFO 1335: Software Engineering Never Received help on this. How do I complete Tasks 1. below while using PHP and MySQL code? Please provide code

INFO 1335: Software Engineering

Never Received help on this. How do I complete Tasks 1. below while using PHP and MySQL code? Please provide code for the following files and give explanations. The textbook used for the class is Murachs MySQL and PHP.

  1. create.sql

  2. Database.php

  3. Database_error.php

  4. Index.php

  5. Grades.php (optional)

  6. Main.css (and any other style files)

Thank you in advance!

Task 1: Create the database

  1. Write a CREATE.sql file to create the schema pictured in figure 1.

    • You should have create statements for each of the tables with all their attributes and keys. Data types are indicated in the figure.

    • Also, create a user that your PHP can use to access the database. This will require both a create and grant statement.

    • Add at least 3 classes and at least 15 grades using at least 2 insert statements in your script.

Figure 1

  1. Test your create script on your VM and adjust as necessary until full functional.

Task 2: Create the front end

  1. Write a database.php to connect to your database on your VM using the credentials created in your script.

    • Hint! We modified a database.php last week in assignment 9. There are examples in chapters 4 and 19. You can use either PDO or mysqli for this assignment.

    • This connection script should include a try/catch for connection. If an error occurs, you will want to include an error or database_error.php script that displays that error to the user. Again, we worked with such a script in assignment 9 or you can find examples in your book. Make sure to include such a script in your application.

  2. Write index.php. This script should select values from the database and display those values to the user using html. You have 2 options to fulfill this requirement:

    • Option 1: Display all grades recorded in the database, grouped and summarized by class. This means that I expect a percentage figured and displayed for each grade, but an overall grade to be calculated and displayed as well. All courses would be displayed on a single html page in separate tables.

      1. This option will look similar to an example in chapter 4 where you have multiple foreach statements.

    • Option 2: Start the user experience by displaying a form where the user would choose a class. On submit of the form, display the grades for that class including the percentage for each assignment and the overall percentage.

      1. This option will require you to make index.php a form with a submit action pointing to an additional file that displays results: grades.php.

      2. This will also require you to bind parameters, using the value(s) entered in the form.

Task 3: Test your application and style as wanted

  1. Test your application by calculating the grades for the records you inserted.

    • If you encounter errors, adjust your code and continue to test until you have a functioning application.

  2. Add any style you wish to dress up your application. In the last assignment, we used a template to help make our application look professional. At a minimum, I will expect a main.css file.

    • Make sure to include any credit statements needed in your html and all needed style files in your final submission.

Task 4: Submission with Git

  1. Upload all of the files needed to complete the steps above to your repository in our GitHub Classroom.

    • Hint! If you need a review of how Git works for homework and submissions, check out the handout and videos in our Start Here section of our online class.

    • Your repo should include at a minimum:

      1. create.sql

      2. Database.php

      3. Database_error.php

      4. Index.php

      5. Grades.php (optional)

      6. Main.css (and any other style files)

  2. Look to the assignment in our online class for our classroom link. This is where I will go to evaluate all your source code.

  3. Include a link to your GitHub repository in your assignment submission.

  4. Then Submit!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions

Question

Describe the two parts of the cell cycle,

Answered: 1 week ago

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago