Unknown Column in Field List. PHP + Mysql

后端 未结 2 884
广开言路
广开言路 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:55

    It looks like the values should be quoted in your $query statement, i.e. $name, $description, and $target_path.

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

提交回复
热议问题