Hello,
The query above is just working on MySQL! But it's not working on PHP!
SELECT user_type, COUNT(user_id) AS sum_users FROM `'._TBLPREFIX.'sessions` GROUP BY user_type ORDER BY sum_users DESC
I have 4 user type defined in Enum type:
VISITOR
EMPLOYER
EMPLOYED
OFFICE
I want to count them, For example:
Visitors: 4
Employeds: 5
Employers: 6
Please help how can i use the query in PHP file?
I'm using the following code but it's not working true:
$getWOB = $MySQL->get_rows_array();
$arr = array(
'VISITORS' => $getWOB['sum_users'][0],
'EMPLOYEDS' => ($getWOB['sum_users'][1] >= 1)?$getWOB['sum_users'][1]:0,
'EMPLOYERS' => $getWOB['sum_users']['EMPLOYER'] + $getWOB['sum_users']['OFFICE'] + $getWOB['sum_users']['COMPANY'],
);