вы можете попробовать это.
<?php
$statuses = array("In-process", "Approved", "Draft", "Approved1" , "Rejected");
$statusVal = [];
foreach ($statuses as $stat) {
$stmt = $db->prepare(
"SELECT COUNT(status) FROM
`m2_exception_requests`
WHERE created_by= ?
and status = ?"
) or die($db->error);
$stmt->bind_param("ss", $user_id , $stat);
$stmt->execute();
$count = $stmt->rowCount();
$statusVal[$stat] = $count;
}
var_dump($statusVal);
вы получите такие значения
[
"In-process" => 1,
"Approved" => 2,
"Draft" => 3,
"Approved1" => 4,
"Rejected" => 5
]