Given the following MYSQL table: persons (The Primary key in the first column and it is an automatic number) Table name: persons column names are highighted prName prSalary prDoB prGender prWilyatSq Table name: wilayats(for Wilayat data) wName prid Salary Birth date Gender Wilayat id wsq Wilayat ID Person ID Name Wilayat Name Nasser Aziz 630 2011-08-03 Muneer Khald 980 2009-01-25 870 2019-03-14 Nizwa Izki 200 M 3 300 M. 2 500 Rawan Sami Bahla F 2 2. Given also the following HTML form page and its source code that is used to add data to MYSQL database Web Browser Output 1. 2. Name:or> 3. Salary:br> 4. Birth Date: 5. Wilayat: 6. Coption value-"x">-- Select -- 7. .. 8. Gender:Male 10. Female 11. Adding data for a new Person Name: Jamal Obaid Salary: 550 Birth Date: 12/20/2002 Wilayat Bahla Gender: O Male O Female Save Data Note the following: • Do NOT write the validation part. Assume that data was input correctly. • Assume that the database connection id is $conn Write PHP code to do the following (use the box below to type your answer) 1. Sanitize ONLY the input value of the Name field. 2. Write the query that will ADD this new data to the persons table which is described above? (note that the prld is an auto-increment field for the person Id) 3. Write the statement that will execute this query 4. Redirect the user to this page newPersonForm.php after the adding process. Type your answer in the box shown below, no file upload is

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Given the following MySQL table: persons (The Primary key in the first column and it is an automatic number)
Table name: wilayats (for Wilayat data)
wsq
Table name: persons column names are highlighted
prid
prName prSalary prDoB prGender prWilyatsq
wName
Person ID
Gender Wilayat id
Salary Birth date
630 2011-08-03
Muneer Khalid 980 2009-01-25
870 2019-03-14
Name
Wilayat ID
Wilayat Name
Nasser Aziz
Nizwa
Izki
Bahla
200
M
3
300
M
2
Rawan Sami
500
F
3
2. Given also the following HTML form page and its source code that is used to add data to MYSQL database
Web Browser Output
1. <form action='saveData.php' method='post'>
2. Name :<input type="text" name="pNm" >br>
3. Salary:<input type="text" name="pSalry" >br>
4. Birth Date:<input type="date" name="pDob" ><br>
5. Wilayat:<select name="pWId">
6. <option value="x">-- Select --</option>
7. <option value="3">Bahla</option>..</select><br>
8. Gender:<input type="radio" name="pG"
9. value="M">Male
Adding data for a new Person
Name: Jamal Obaid
Salary: 550
Birth Date: 12/20/2002
Wilayat Bahla
Gender: O Male O Female
10. <input type="radio" name="pG" value="F">Female
11. <input type="submit" name="save" value="Save Data">
Save Data
Note the following:
• Do NOT write the validation part. Assume that data was input correctly.
• Assume that the database connection id is $conn
Write PHP code to do the following (use the box below to type your answer)
1. Sanitize ONLY the input value of the Name field.
2. Write the query that will ADD this new data to the persons table which is described above? (note that the prld
is an auto-increment field for the person Id)
3. Write the statement that will execute this query
4. Redirect the user to this page newPersonForm.php after the adding process.
Type your answer in the box shown below, no file upload is
Transcribed Image Text:Given the following MySQL table: persons (The Primary key in the first column and it is an automatic number) Table name: wilayats (for Wilayat data) wsq Table name: persons column names are highlighted prid prName prSalary prDoB prGender prWilyatsq wName Person ID Gender Wilayat id Salary Birth date 630 2011-08-03 Muneer Khalid 980 2009-01-25 870 2019-03-14 Name Wilayat ID Wilayat Name Nasser Aziz Nizwa Izki Bahla 200 M 3 300 M 2 Rawan Sami 500 F 3 2. Given also the following HTML form page and its source code that is used to add data to MYSQL database Web Browser Output 1. <form action='saveData.php' method='post'> 2. Name :<input type="text" name="pNm" >br> 3. Salary:<input type="text" name="pSalry" >br> 4. Birth Date:<input type="date" name="pDob" ><br> 5. Wilayat:<select name="pWId"> 6. <option value="x">-- Select --</option> 7. <option value="3">Bahla</option>..</select><br> 8. Gender:<input type="radio" name="pG" 9. value="M">Male Adding data for a new Person Name: Jamal Obaid Salary: 550 Birth Date: 12/20/2002 Wilayat Bahla Gender: O Male O Female 10. <input type="radio" name="pG" value="F">Female 11. <input type="submit" name="save" value="Save Data"> Save Data Note the following: • Do NOT write the validation part. Assume that data was input correctly. • Assume that the database connection id is $conn Write PHP code to do the following (use the box below to type your answer) 1. Sanitize ONLY the input value of the Name field. 2. Write the query that will ADD this new data to the persons table which is described above? (note that the prld is an auto-increment field for the person Id) 3. Write the statement that will execute this query 4. Redirect the user to this page newPersonForm.php after the adding process. Type your answer in the box shown below, no file upload is
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Single Table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education