$nick = addslashes($nick);
$query = "SELECT Nick FROM presenti where nick = '$nick'";

se tra i nick utenti non c'è Antonio allora:
$query = "INSERT INTO presenti (nick) values('$nick')";