[Solved] How to store and display an image in MySQL database


Well, you gave a different name for the file in the input file tag in your form.

Change this

<input type="file" name="image" ><br>

to this

<input type="file" name="file" ><br>

and it should work. Let me know if it doesn’t.

You may also consider putting the contents in upload_file.php in an if-conditional to prevent it from execution on direct access as follows:

<?php
if(isset($_POST['submit'])) {
    // Your code here    
}

10

solved How to store and display an image in MySQL database