php - Files are not uploading to a database

Solution:
This is because
if (isset($_POST['btn'])) {
will never happen. A button does not post a value
replace it with
if (isset($_FILES['myfile'])) {
or replace the submit with
<input name="btn" type="hidden" value="somevalue">
<input type="submit" value="Upload">
The later will keep your php as is but post a value with the namebtn
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: property [id] does not exist on this collection instance.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.