Answer the question
In order to leave comments, you need to log in
How to combine 2 MYSQL (PDO) queries into 1?
$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'));
Answer the question
In order to leave comments, you need to log in
in fact, the answer was already given by Sergey
, if more precisely, then apparently like this:
DB::$the->prepare('UPDATE statistic SET request = request + 1 WHERE id = ?')->execute(array(1));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question