Dovrebbe essere

codice:
select count(iduser),iduser from tabella
where statofoto=0
group by iduser
bye