Answer the question
In order to leave comments, you need to log in
How to make 1 out of 2 MYSQL (PDO) queries?
Here are the requests
$get= DB::$the->query("SELECT request FROM `statistic` WHERE `id` = '1' ");
$get= $get->fetch(PDO::FETCH_ASSOC);
DB::$the->prepare("UPDATE statistic SET request=? WHERE id=? ")->execute(array($get['request']+1, '1'));
update statistic set request = request + 1 where id = 1
Answer the question
In order to leave comments, you need to log in
And who prevents PDO from making a request conditionally
As it will be atomic unlike your first variant.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question