I'm trying to build a SQL query for my PHP code that will count & display the number of assignments from data within my MySQL database. I only need to display & count the active and the ones locaed in office2. Below is my SQL query but it is displaying & counting all workers:
$query="SELECT worker, active, COUNT(worker) FROM psrinfo WHERE location = 'office2' AND active = '1' ";
I have a total of 10 workers. I only need to display worker1, worker2, worker3, worker4, worker6 and worker8.
At this time it counts all workers 1 - 10