io uso un discorso tipo cosi
Codice PHP:
if(!isset($user_allowed)OR $user_allowed  ==''){
echo
"Il campo titolo e obbligatorio";
echo
"<script type=\"text/javascript\">";
echo
"setTimeout(\"location.href='setting.php?setting=security_setting'\",3000)";
echo
"</script>";
return;
}else{
$controllo_user_name_allowed mysql_query("SELECT * FROM username_vietati WHERE user_nomi_vietati ='$user_allowed'");
if(@
mysql_num_rows($controllo_user_name_allowed)!=0){
echo
"L user e gia presente nel database";
echo
"<script type=\"text/javascript\">";
echo
"setTimeout(\"location.href='setting.php?setting=security_setting'\",3000)";
echo
"</script>";
}else{


$modifico_username_vietati mysql_query("UPDATE username_vietati SET user_nomi_vietati='$user_allowed' WHERE id='1'");
if(
$modifico_username_vietati){
echo
"Modifica effettuata";
echo
"L user e gia presente nel database";
echo
"<script type=\"text/javascript\">";
echo
"setTimeout(\"location.href='setting.php?setting=security_setting'\",3000)";
echo
"</script>";

}else{
echo 
"errore".mysql_error();
}
}