Answers for "Uncaught PDOException: SQLSTATE[42S22]: Column not found:"

0

Uncaught PDOException: SQLSTATE[42S22]: Column not found:

$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);
}
Posted by: Guest on April-01-2022

Code answers related to "Uncaught PDOException: SQLSTATE[42S22]: Column not found:"

Browse Popular Code Answers by Language