$sql = <<prepare($sql); $res->execute( array( ':visitor' => $visitor, ':ip' => $ip, ':myDate' => $myDate, ':notes' => $notes, ':httpref' => $httpref, ':httpagent' => $httpagent, ':visitormail' => $visitormail, ':dl_dir' => $dl_dir, ':attn' => $attn ) ); $rescnt = $res->rowCount(); // error message: PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''ZH'')' at line 2' // EDIT: I removed the apostrophe after :attn in the sql statement... now works!