Constructing an if, if else, else statement

Posted by Luke on Stack Overflow See other posts from Stack Overflow or by Luke
Published on 2010-05-01T20:12:05Z Indexed on 2010/05/01 20:17 UTC
Read the original article Hit count: 210

Filed under:
/* Errors exist, have user correct them */
    if($form->num_errors > 0)
    {
         return 1;  //Errors with form
    }
     /* No errors, add the new account to the */
    else if($database->addLeagueInformation($subname, $subformat, $subgame, $subseason, $subwindow, $subadmin, $subchampion, $subtype))
    {
        $database->addLeagueTable();
        $_SESSION['players'] == $subplayers;
        $comp_name == '$format_$game_$name_$season';
        $_SESSION['comp_name'] == $comp_name;
        return 0;  //New user added succesfully
    }
    else
    {
        return 2;  //Registration attempt failed
    }

At the moment this isn't doing any of these things\:

$database->addLeagueTable();
    $_SESSION['players'] == $subplayers;
    $comp_name == '$format_$game_$name_$season';
    $_SESSION['comp_name'] == $comp_name;

Is there a better way to do this?

© Stack Overflow or respective owner

Related posts about php