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
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
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F104686bc-55ec-40a7-b872-c208536f25ff%2F6ae238ad-6860-415d-acdb-2a93fa5c90a4%2Fxninyal_processed.jpeg&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
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.Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education