//Image Upload
$uploaddir = "../img/";
$uploadfile = $uploaddir .$name. basename($_FILES['userfile']['name']);
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile);
mysql_query("update student set sname='$sname', fname='$fname', dob='$dob', contact='$contact', address='$address', simg='$fpath' where studid=$studid"); 

You didn't ask a question. Your post has a title and a code dump but nothing else. I take it you are just sharing.

If this is a guide how to do something it has serious issues:

  • POST variables are not being sanitized so arbitrary code can be injected
  • An old and deprecated mysql extension is used

So sanitize (check, validate, cast, replace, blacklist, whitelist...) the post data and switch to the PDO extension for accessing the DB.