Constructing an if, if else, else statement
- by Luke
/* 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?