You override your variable $a
$a = $_POST['id']; // assign here
$a = $db->prepare($sql);// override here
Try to give a different name
$smt = $db->prepare($sql);
$smt->execute(array(':a'=>$a,':b'=>$b,':c'=>$c,':d'=>$d,':e'=>$e));
header("location: books.php");
solved PHP-MySQL error inserting data