How to do multiple UPDATE in one request?

From f-tsii comes in an array that I parse and check what the statuses returned, and then I need to put this data in the database.
foreach ($result as $value) {
 if ($value["Status"] == 1) {
 $arraySuccessRequests[] = array(
 'Id' => $value["Id"],
 'Request' => $value["Request"]
);
 } elseif ($value["Status"] == 0) {
 $arrayFailedRequests[] = array(
 'Id' => $value["Id"],
 'Request' => $value["Request"]
);
}
 }

For Status == 1:
UPDATE orders SET Request = " . $result["request"] . "WHERE Id =" . $order["Id"] .

For Status == 0:
UPDATE orders SET StatusId = 4, Error = " . $result["request"] . "WHERE Id =" . $order["Id"] .

That's all I want to do 2 queries in the DB, tell me how can I do that?
March 20th 20 at 11:30
2 answers
March 20th 20 at 11:32
Why you want only 2 request? Not the fact that it will be faster.

You can, for example, like this:
update orders
 join (select $id1 id, $request1 request from dual
 union all
 select $id2, $request2 from dual) data
 on orders.id=data.id
 set request=, data.request

Or to do the procedure.
Because the host says, they say a lot of DB queries is because of this I get a 500 Error sometimes :( - Margarete_Keeli commented on March 20th 20 at 11:35
March 20th 20 at 11:34
Here is just discussing the other day.

Find more questions by tags PHPMySQL