usa count(*)

codice:
select count(*) as tot
from tabella
where username = 'nome_esatto'

.....
.....

if($row['tot'] == 0 ) esegui insert
else "hai gia' votato"