I would like to calculate the rows in the table with each other condition. I have this in some way, but it does not work.
$sql = "SELECT
(SELECT COUNT(name) FROM orders) as total,
UNION ALL
(SELECT COUNT(name) FROM orders WHERE status='1') as ok,
UNION ALL
(SELECT COUNT(name) FROM orders WHERE status='2') as ko";