I would appreciate if anyone could tell me why Im getting a syntax error with this code:
if(isset($_POST['submit']))
{
$dbcon = mysqli_connect("localhost","user1","test1","tutorial");
$stored_file = $_FILES["file"]["name"];
$query="INSERT INTO store (filname, uppladdare, titel) VALUES
**Line 136->**('$_POST[**file**]$stored_file','$_POST[uppladdare]','$_POST[titel]')";
if(!mysqli_query($dbcon ,$query));
}
Notice: Undefined index: file in/Applications/XAMPP/xamppfiles/htdocs/projekt webb/laddaupp.php on line 136
The function works fine and Im storing all the data that I want. But Im still getting an error. I can always "fix" this by using reporting_error. But I prefer to learn by my mistakes.
/thanks
EDIT: The stars are not part of the coding. Just to show where the error occurs!
The final result:
$query="INSERT INTO store (filname, uppladdare, titel) VALUES ('$stored_file','$_POST[uppladdare]','$_POST[titel]')";
Thanks for the answers pals!:)