For some reason my files are not uploading to my database. I have my file upload turned on in my php.ini file and have tried uploading files less than 2 mb but no luck so far. I am pretty new to programming so please bear with me.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Upload PDF & Word files to Database</title>
</head>
<body>
<?php
$dbh = new PDO("mysql:host=localhost;dbname=database", "user", "root");
if (isset($_FILES['myfile'])) {
$name = $_FILES['myfile']['name'];
$mime = $_FILES['myfile']['type'];
$data = file_get_contents($_FILES['myfile']['tmp_name']);
$stmt = $dbh->prepare("INSERT INTO myblob VALUES('',?,?,?)");
$stmt->bindParam(1, $name);
$stmt->bindParam(2, $mime);
$stmt->bindParam(3, $data, PDO::PARAM_LOB);
$stmt->execute();
}
?>
<form method="post" enctype="multipart/form-data">
<input type="file" name="myfile"/>
<input name="btn" type="hidden" value="Value">
<input type="submit" value="Upload">
</form>
</body>
</html>