As I suggested in the comment, one method is to refactor using a CASE WHEN clause.
You should be able to use a DB:raw select statement with your update method call.
$data = '(SELECT CASE Bib_no';
foreach ($ids as $i => $id) {
if (!array_key_exists($i, $chestnos)) {
/* uncomment to
…
Top comments (0)