vorresti dire che dovrebbe andare cosi:
"SELECT * FROM $tabemail where gruppo = '$nome_gruppo' and stato = 'attivo' ";


?