未捕获的PDOException:SQLSTATE [42S22]:找不到列:1054

时间:2019-05-31 05:24:38

标签: php mysql sql

我正在尝试向$size表中注入一些值,但无法识别其中一列。

php代码

SQL

$db = get_PDO(); for ($i = 0; $i < count($names); $i++) { $sql = "INSERT INTO presidents(name, year, vice_president) " . "VALUES (:name, :year, :vice_president);"; $stmt = $db->prepare($sql); $params = array("name" => $names[$i], "year" => $year[$i], "vice_president" => $vice_president[$i],); $stmt->execute($params); } $names$year是数组

sql代码

$vice_president

我收到此错误:

  

致命错误:未捕获PDOException:SQLSTATE [42S22]:找不到列:1054“字段列表”中的未知列“ vice_president”

0 个答案:

没有答案