Неизвестный столбец в списке полей. PHP + Mysql
Я пытаюсь добавить значения в таблицу в phpmyadmin, и я получаю сообщение об ошибке: Неизвестный столбец «...» в «списке полей».
Вот мой код:
<?php
//preparing the patch to copy the uploaded file
$target_path = "images/";
//adding the name of the file, finishing the path
$target_path = $target_path . basename( $_FILES['image']['name']);
//moving the file to the folder
if(move_uploaded_file($_FILES['image']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['image']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
//getting input from the form
$name = $_POST['game'];
$description = $_POST['beschrijving'];
//preparing the query to insert the values
$query = "INSERT INTO tblGames (name, description, image) VALUES ($name, $description,". $target_path .")";
//opening connection to db
$link = mysql_connect('localhost', 'root', '');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
//selecting a db
mysql_select_db("BouncingGiani", $link) or die(mysql_error());
//running the query
$result = mysql_query($query) or die (mysql_error());
//closing the connection
mysql_close($link);
?>
поэтому, когда я ввожу fds в качестве имени в форме на предыдущей странице, я получаю: Неизвестный столбец «fds» в «списке полей». Это никогда не случалось со мной раньше, и я понятия не имею, что происходит.