I have this code:
if (condition){ //number1
if (condition){ //number2
action
}
}
else{
action
}
Now if the nested if statement, number 2, turns out to be false is if possible to ‘redirect’ the program to the outside else statement rather than creating a nested else statement like so?
if (condition){ //number1
if (condition){ //number2
action
}
else {
action;
}
}
else {
action
}
Edit: Here is my actual code:
if ($s == 5){ //which award is won
$id_raw = $wpdb->get_var("SELECT user_ID FROM ".$wpdb->prefix."award".$award." WHERE user_ID='".$p_uid."'"); //check to see if user has already won this award
if($id_raw==''){ // if he/she didnt make entry saying they did
$wpdb->query("INSERT INTO ".$wpdb->prefix."award1 (user_ID, isTold) VALUES(".$p_uid.", 'false') ") or die(mysql_error());
wp_delete_post( $pid, true );
}
}
else{
cp_points('voteitup_user_up', $uid, get_option('cp_module_voteitup_user_up'), $pid);
cp_points('voteitup_author_up', $p_uid, get_option('cp_module_voteitup_author_up'), serialize(array($pid,$uid)));
}
Just guessing what you actually want to do here, since your
id_raw = ''is a nonsense condition and the question is unclear:Hope this gives you an idea.