I've made a form that once submitted should insert data into a database. It works if I use variable names in the query string like INSERT INTO table (name, comment) VALUES ($name, $comment), but it doesn't work if I use pdo prepared statements, heres the code I currently have:
move_uploaded_file($_FILES["file"]["tmp_name"], "../img/" . $_FILES["file"]["name"]);
$stmt = $conn->prepare('INSERT INTO instructors (name, bio, picture) VALUES (:name, :bio, :picture)');
$stmt->bindParam(':name', $_POST['name']);
$stmt->bindParam(':bio', $_POST['bio']);
$stmt->bindParam(':picture', $_POST['file']['name']);
$stmt->execute();
The file get's uploaded and moved to the directory I stated, but no data gets inserted into the database. Any ideas why?