inserting image in database using php [closed]

$file=$_FILES['image']['tmp_name'];

I believe the error is being generated here because, when it isn’t set, the image index is undefined (kapow!)

You could try this instead:

if ( ! isset($_FILES['image']))
{
    echo 'Please select a file..';
}
else
{
    // your code
}

Leave a Comment