We will be creating a table within a MySQL database and using a form to input data into the table. Please follow the steps below. Here is the table: faculty_info.
RECORD_NO |
FACULTY_ID Faculty GWED in the form G123 |
FACULTY_LASTNAME Faculty last name |
FACULTY_FIRSTNAME Faculty first name |
FACULTY_OFFICE Faculty office information |
1 |
G001 |
Dasgupta |
Subhasish |
Funger515B |
2 |
G002 |
Carayannis |
Elias |
Funger515C |
3 |
G003 |
Park |
YoungKi |
Funger515D |
1.Using phpMyAdmin create a database called faculty in MySQL.
2.Create a table called faculty_info in the database faculty.
a.The table should have the following fields: RECORD_NO, FACULTY_ID, FACULTY_LASTNAME, FACULTY_FIRSTNAME, and FACULTY_OFFICE
b.Choose the appropriate format of the fields so that the table can store data as shown above.
c.RECORD_NO should be an auto-increment
d.Use the print function in phpMyAdmin to create a pdf of your table structure and submit it as your solution.
3.Enter the three records shown above. Create a pdf of your table with the records. The should look similar to table: faculty_info above and should have all its components. Submit the pdf as your solution.
4.In php/html create a form to enter data about additional faculty into the table: faculty_info. The file naming convention is add_yourname_form.html or add_yourname_form.php
5.Use the php file provided to connect your form from step 3 above to the MySQL database: faculty.
a.Modify the connection parameters – use your database password
b.Include a SQL so that the php file can insert the data provided in form
c.You also need a confirmation that the data has been added.
d.Name the file add_yourname.php
e.Provide pdf copies of the code for the two or more files you created.
6.Use the form and the connection file you created in steps 3 and 4 above to enter data about two additional faculty members:
RECORD_NO |
FACULTY_ID Faculty GWED in the form G123 |
FACULTY_LASTNAME Faculty last name |
FACULTY_FIRSTNAME Faculty first name |
FACULTY_OFFICE Faculty office information |
4 |
G004 |
Artz |
John |
Funger515E |
5 |
G005 |
Duan |
Wenjing |
Funger515F |
a.Using phpMySQL create a pdf of all the records in the table and submit as your solution.
7.Create a screen capture video that shows you are adding faculty information. For the video show that you are adding your own name as a faculty member. Then show all the records in the faculty_info table. Remember the video should clearly show that your files are in AWS.
The only starter file provided for this assignment is: add_course_sample.php.
THIs IS THE starter file..
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> Course Management Systems - New Course </title>
</head>
<body>
<?php
/*
Filename: add_course.php
Description: This file takes the data provided by a form and adds it to a table within a MySQL database
Author: Subhasish Dasgupta
Date: October 13, 2019
*/
//MySQL connection parameters. Remains the same for all connections to the database
$servername = "localhost";
$username = "root";
$password = "put your MySQL password here";
// Create connection
$conn = mysqli_connect($servername, $username, $password);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
//Select database
mysqli_select_db ( $conn , 'department' );
// SQL statement to insert form posted data into table:course and store statement in a variable $sql
// the variable parameters on the right are inside the $_POST are received from the form.
$sql = "INSERT INTO course set DEPT_CODE = '$_POST[gwsbid]',
COURSE_NO = '$_POST[course_no]',
COURSE_TITLE = '$_POST[course_title]',
SECTION_NO = '$_POST[section_no]'";
// Insert SQL data in MySQL database table
mysqli_query($conn, $sql);
// Display confirmation
echo "Your new course has been created. <br>";
// Close connection
mysqli_close($conn);
?>
</span>
</body>
</html>