First of all:
=> Do you realize that PhP runs on the server, and once the server has produces the webpage, PhP is not involved anymore untill you make a new call to the server?
In other words: You have a javascript function: onChange="change_pationt(this.value). Does this make a call to the server to reload the page?
Is that happens, you are on the right way. Just for testing, place these two lines of code on the lop of your php code:
print_r($_POST);
print_r($_GET);
This will show you which variables are being passed to the page. If you are getting the patient ID (FileNO) through to that page, you are on track; Let us know what that gives you and we will look again.
In short what you then need to do is change te query to:
if(is_numeric($_POST['FileNO']))
{
$filenr = $_POST['FileNO'];
$query="SELECT * FROM pationt where FILECOLUM = $filenr";
}
else
{
$query="SELECT * FROM pationt where FILECOLUM = $filenr";
}