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);
$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.
");``echo("$naam");``$update=$dbh->prepare("UPDATE activiteiten SET naam= :naam WHERE id= :id");``$update->bindParam(':id', $id);``$update->bindParam(':naam', $naam);``$update->execute();`. In essence only $select_posts has been change to $update as far as I can tell, which is irrelevant. Still not sure what has caused the problem though. However, I do thank you kindly for your suggestions! :) – Jay Feb 06 '11 at 17:41