HTML code:
<input type="file" name="files[]" multiple="multiple" id="photo" >
PHP code:
$query1="insert into imgtab values('".$ka."','".addslashes(file_get_contents($_FILES['files']['name'][$i]))."')";
Error:
Warning: file_get_contents(Screenshot (5).png): failed to open stream: No such file or directory in C:\xampp\htdocs\q.php on line 16
How can I solve this error?
$_FILES['files']['name']refers to the name of the file before it was uploaded. You really need to use move_uploaded_file before you start storing anything in the database. Have a look here php.net/manual/en/function.move-uploaded-file.php