There's nothing obvious, but you said it's been working and now does not, so that would suggest something data-related.
I don't understand why you have the UPDATE and SELECT queries after the insert, unless there could be more than one row containing the same values for
all_clicked. If you insert a row, there's no need to update that same row, and there's no need to SELECT it either. Just check that the insert query worked, and go from there.
Exactly that. Have a look at these two queries, you can see that in the first
//insert button click
$query = "INSERT INTO " . $DBPrefix . "buttonclicked (auction_id, all_clicked) VALUES(:auction_id, :all_clicked);";
$params = array();
$params = array(':auction_id', $id, 'int');
$params = array(':all_clicked', $_POST['all_clicked'], 'str');
you clear the array before adding parameters to it, but in the next
//update button click
$query = "UPDATE " . $DBPrefix . "buttonclicked SET all_clicked = :all_clicked
WHERE auction_id = :auction";
$params = array(':all_clicked', $_POST['all_clicked'], 'int');
$params = array(':auction', $id, 'int');
you don't, so by the time the update query is run,
params() now has four elements in it. If the code has been working before, then obviously your
->query() function doesn't mind that.