First of all, to know if any row is updated or not, check value of your variable
n
if it is 0 means no record is matching the criteria you are defining for update.
So check the value of varible
medicinename
in your table exists on not.
This is all can your suggest by looking at your code.