Please help in PHP

Create a database like Result having table
Student_Data(Sid,Sname,Total,Percentage,Total).
Write a PHP script to store the above information using form and
perform the below validation:

  1. Total must be out of 500.
  2. Percentage & grade should be calculate after the submit
    button press and Store the same on DB.