Issues incrementing a field in MySQL/PHP with prepared statements
问题 I have the following code which is supposed to increment a field value by 1 in a prepared PHP mysql statement: function db_OP_doVote($pdo, $postid, $votetype) { $prepStatement = $pdo->prepare( "UPDATE content_posts SET `:votetype` = `:votetype` + 1 WHERE `id` = :id" ); $prepStatement->execute(array(':votetype' => $votetype, ':id' => $postid)); echo "Success"; } This however, does nothing. No error is thrown back about incorrect SQL syntax and the script runs to completion, but my field does