Question
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.
-
create.sql
-
Database.php
-
Database_error.php
-
Index.php
-
Grades.php (optional)
-
Main.css (and any other style files)
Thank you in advance!
Task 1: Create the database
-
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
-
Test your create script on your VM and adjust as necessary until full functional.
Task 2: Create the front end
-
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.
-
-
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.
-
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.
-
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.
-
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
-
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.
-
-
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
-
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:
-
create.sql
-
Database.php
-
Database_error.php
-
Index.php
-
Grades.php (optional)
-
Main.css (and any other style files)
-
-
-
Look to the assignment in our online class for our classroom link. This is where I will go to evaluate all your source code.
-
Include a link to your GitHub repository in your assignment submission.
-
Then Submit!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started