nell'ultima query dovresti sostituire l'and col where

comunque come ti hanno fatto notare più sopra avrebbe più senso verificare che il result set restituito abbia dei record piuttosto che vedere se amministratore sia = 1 dato che è una condizione già fissata nella query