So I was getting this error then I enlosed the column names in the backtick character and the error was resolved, my query looked something like this
$sql="INSERT INTO camera (type, company, model, tvl, range, ir, mrp, price, warranty, image)
VALUES
('$ftype','$fcompany','$fname','$ftvl','$frange','$fir','$mrp','$price','$fwarranty','$pathAndName')";
And now it looks something like this and is working fine
$sql="INSERT INTO camera (`type`, `company`, `model`, `tvl`, `range`, `ir`, `mrp`, `price`, `warranty`, `image`)
VALUES
('$ftype','$fcompany','$fname','$ftvl','$frange','$fir','$mrp','$price','$fwarranty','$pathAndName')";
Now I figured out that I was getting this error because I was using some keyword in my query, my question is which keyword was causing this error, was it range? I tried the query without using the range column but still I was getting the same error.