PDO error: " SQLSTATE[HY000]: General error " When updating database

Solution 1:

You do not use fetchAll(),as in

$result = $stmt->fetchAll();

with update or insert queries. Removing this statement should rectify the problem.

Solution 2:

Just to note, another possible reason for this error is if you make a second database call with the variable $stmt inside of an existing parent $stmt loop.

     $stmt = $conn->query($sql);

    while ($row = $stmt->fetch()) {  //second use of $stmt here inside loop