Simple PHP with PDO statement to update MySQL table doesn't work [closed]
I'm having a rather hard time seeing what is going wrong with the following lines of code:
$id = $_POST["id"];
$naam = $_POST["naam"];
echo("$id<br />");
echo("$naam");
$select_posts=$dbh->prepare("UPDATE activiteiten SET naam= :naam where id= :id");
$select_posts->bindParam(':id', $id);
$开发者_C百科select_posts->bindParam(':naam', $naam);
$select_posts->execute();
I'm echoing $id and $naam, just to make sure there's something there. Furthermore, the SQL statement is valid in the sense that, when executed in PHPDBAdmin the records get updated. However, using this code no updates nor errors occur.
I've had this working before, yet right now I have no clue as to why it's not functioning as it should.
精彩评论