Unknown Column in Field List. PHP + Mysql

后端 未结 2 894
广开言路
广开言路 2021-02-09 16:22

I\'m trying to add values to a table in phpmyadmin and I get the error: Unknown column \'...\' in \'field list\'.

Here\'s my code:

    

        
2条回答
  •  北恋
    北恋 (楼主)
    2021-02-09 16:41

    I think this

    $query = "INSERT INTO tblGames (name, description, image) VALUES ($name, $description,". $target_path .")";
    

    should be

    $query = "INSERT INTO tblGames (name, description, image) VALUES ('$name', '$description', '". $target_path ."')";
    

提交回复
热议问题