3 ms·
The problem is that `bindparam` binds by reference, and `foreach` reuses the same variable for `$value`, with the same reference, in the loop? Then the solutio
by bartl 14y ago
The problem is that `bindparam` binds by reference, and `foreach` reuses the same variable for `$value`, with the same reference, in the loop?
Then the solution could be to use `&$value` instead. Untested:
foreach( $bind_params as $key => &$value ){
$statement->bindParam($key, $value);
}
unset($value);
BTW The fact that you need to manually break the connection between the loop variable and the array item value using `unset` is a bug, in my opinion.