开发者

Simple PHP with PDO statement to update MySQL table doesn't work [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 9 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜