Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

SYST10199: Assignment 4 © Sheridan College Overview Databases Write an app that builds and modifies the sports.sql database provided: · Create 3 pages - an insert page, a delete page (by), and an...

1 answer below »
SYST10199: Assignment 4
© Sheridan College
Overview
Databases
Write an app that builds and modifies the sports.sql database provided:
· Create 3 pages - an insert page, a delete page (by), and an update page (by).
· Each page redirects to a PHP program that attempts to perform the operation and display the result.
· Don’t wo
y about security.
· Create a 4th page that allows users to view the contents of the database. They should be able to choose the fields they see and either look up a single record or a range of records.
· Note: you will have to add the capability to choose which fields will be displayed.
The Rules
· This is a primarily a programming task. The performance of your program will be judged on how well it meets the criteria outlined above rather than how pretty it looks.
· There should be no bugs or e
ors in the JavaScript console.
· The forms should meet the specifications listed above and you should put at least a little effort into its appearance, but you are not being graded on graphic design.
· The HTML, CSS, JavaScript, database, and PHP should contain no warnings or e
ors when loaded in NetBeans.
· The CSS and JavaScript should be loaded from separate files.
· All files should have a header comment with a
ief description and your name. Each JavaScript function and global variable should have a
ief one line comment explaining what it does. Put this comment above the variable or function.
· The main file should be called index.html and should be hosted on your mobile space.
Submission Instructions - Please follow carefully
1. See the SLATE calendar for the due date.
2. Host on your cPanel web space at this address: http:
dev.fast.sheridanc.on.ca/~yourusername/A# where # is the assignment number.
3. In SLATE, add a comment to the dropbox that includes your mobile web space address as a clickable link.
4. Zip up the entire project folder and hand it in the co
ect dropbox on SLATE. 
Zip files ONLY, do NOT submit .rar files.
Evaluation
1. For each submission instruction not complied with, there will be a deduction of 0.5 marks.
2. Performance (4.5 marks): For each console e
or or bug or e
or in the application & any of the rules above not adhered to, there will be a deduction of 0.5 marks.
3. For each requirement not met there will be a deduction of 0.5 marks.
4. Internal Documentation (comment your code) 0.5 marks.
This assignment is worth 10% of your final grade. Total marks 10. The work must be your own.
Answered Same Day Apr 13, 2021

Solution

Pulkit answered on Apr 14 2021
141 Votes
PHP/database.php
?php
$servername='localhost';
$username='root';
$password='';
$dbname = "sports";
$conn=mysqli_connect($servername,$username,$password,"$dbname");
if(!$conn){
die('Could not Connect My Sql:' .mysql_e
or());
}
?
PHP/delete-process.php
?php
include_once 'database.php';
$sql = "DELETE FROM sports WHERE userid='" . $_GET["userid"] . "'";
if (mysqli_query($conn, $sql)) {
echo "Record deleted successfully";
} else {
echo "E
or deleting record: " . mysqli_e
or($conn);
}
mysqli_close($conn);
?
PHP/delete.php
?php
include_once 'database.php';
$result = mysqli_query($conn,"SELECT * FROM sports");
?
!DOCTYPE html
html
head
title>Delete sports data
title
head
ody
table
Sports Id
td
First Name
td
Last Name
td
Field
td
Medal
td
Action
td

t
$i=0;
while($row = mysqli_fetch_a
ay($result)) {
?
?php echo $row["userid"]; ?
td
?php echo $row["first_name"]; ?
td
?php echo $row["last_name"]; ?
td
?php echo $row["field_name"]; ?
td
?php echo $row["medal_name"]; ?
td
a href="delete-process.php?userid=">Delete
a
td

t
$i++;
}
?
table
ody
html
PHP/insert.php

First name:


Last name:


Field Name:


Medal:



PHP/process.php
?php
include_once 'database.php';
if(isset($_POST['save']))
{
$first_name = $_POST['first_name'];
$last_name =...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here