Tutorial 14 PHP oop and Ajax with Jquery
- Create a class called "Student" that inherits from "Person" and has an additional property "major". Override the "greet" method to return "Hello, my name is [name], I am [age] years old and I am majoring in [major]."
- Create a method in the Person class called setAge that accepts a new age as an argument and updates the age property. Create a similar method in the Student class called setStudentId that accepts a new student ID as an argument and updates the studentId property, and in the Teacher class called setTeacherId that accepts a new teacher ID as an argument and updates the teacherId property and finally print all.
- Demonstrate the use of load, get and Post methods of ajax using jquery.
- Write a PHP script with jQuery using ajax method to show the number of years in the selection box based on the selection of courses in the selection box above.
- You will require 2 tables in database
- Course and year tables given below.
- Output of the question also given below.




********************************************************************************