0% found this document useful (0 votes)
22 views

Practical Test

The document provides instructions for setting up tables in a MySQL database to store employee and medical data, and then using PHP to create forms to add, view, and modify employee records. It describes creating two tables - employee to store basic employee information and employee_medical to store each employee's medical notes linked by a shared employee ID. It then outlines creating a PHP form to insert new employee records across both tables, and displaying an index page that lists all employees with their details joined from both tables along with edit/delete links.

Uploaded by

Zack Seven
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Practical Test

The document provides instructions for setting up tables in a MySQL database to store employee and medical data, and then using PHP to create forms to add, view, and modify employee records. It describes creating two tables - employee to store basic employee information and employee_medical to store each employee's medical notes linked by a shared employee ID. It then outlines creating a PHP form to insert new employee records across both tables, and displaying an index page that lists all employees with their details joined from both tables along with edit/delete links.

Uploaded by

Zack Seven
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Practical Test MySQL:

1. Create a new schema named practical_test. 2. Create a new table named employee with the following fields: a. emp_id (INT, Auto increment) b. emp_name (VARCHAR 100) c. emp_ic (VARCHAR 20) d. emp_phone (VARCHAR 20) e. emp_address (VARCHAR 200) 3. Create a new table named employee_medical with the following fields: a. id (INT, Auto increment) b. emp_id (INT) c. medical_notes (TEXT)

PHP:
4. Create form to add new employee into database, fields included: a. Employee Name b. Employee IC c. Employee Phone d. Employee Address e. Medical Notes Hints: Use mysql_insert_id() to insert emp_id into employee_medical table 5. List all the employees from database in table with two action links to update employees information and delete employee from database. a. Note: Display emp_id, emp_name, emp_ic, emp_phone, emp_address from employee table, and medical_notes from employee_ medical table. b. Hints: Use JOIN method to join two tables and retrieve data.

Tips:

It would be better if you learn how to write these PHP codes, rather than just copy from the examples online and paste to your source files. You could learn more by writing the codes. Good luck!

You might also like