follows the query that should work
SELECT (select count(paciente_id) from agenda where paciente_id='0') as id0, (select count(paciente_id) from agenda where paciente_id<>'0') as idok from agenda;
no result just get your var so $resultado['id0']
to id = 0 and $resultado['idok']
to ids <> 0
If you need a date
SELECT (select count(paciente_id) from agenda where paciente_id='0' and dia_consulta='$data') as id0, (select count(paciente_id) from agenda where paciente_id<>'0' and dia_consulta='$data') as idok from agenda;
where query_day you trade by its date field and date has its date chosen, OBs you should treat the date appropriately for the query.