Answer the question
In order to leave comments, you need to log in
How to make sql update better?
You need to do several hundred updates at a time in some rows in the table.
$views = 'какое то число';
$q = $pdo->prepare('UPDATE articles SET views=? WHERE id=?');
foreach ($rows AS $id) {
$q->execute([$views, $id]);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question