io non capisco perche questo codice eseguito solo funziona
richiamato come function no

codice:
function nick ($id_utente){
  $selectnick="select * from utenti where id = '".$id_utente."' ;";
			$query_nick = mysql_query($selectnick,$link);
			$nick = mysql_fetch_array($query_nick);
			echo $nick[utente];

}
grazie per l'aiuto
l'errore è

Warning: mysql_query(): supplied argument is not a valid MySQL

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL