OOP function and if statement

Posted by Luke on Stack Overflow See other posts from Stack Overflow or by Luke
Published on 2010-05-01T09:16:47Z Indexed on 2010/05/01 9:17 UTC
Read the original article Hit count: 308

Filed under:

Not sure if I can ask two questions?

If i run the following function in my database class

function generateUserArray() 
{
    $u = array();
    $result = $this->selectAllUsers();
    while( $row=mysql_fetch_assoc($result)) 
    {
         $u[] = $row['username'];
    }
    return $u;
}

Would i call it like this?

        $u[] = $datebase->generateUserArray();

My second question, will this work:

        else if($database->addLeagueInformation($subname, $subformat, $subgame, $subseason, $subwindow, $subadmin, $subchampion, $subtype)
                                            && $databases->addLeagueTable($name) && $_SESSION['players'] == $subplayers && $comp_name =     
                                            "$format_$game_$name_$season" && $_SESSION['comp_name'] = $comp_name)

Thankyou

© Stack Overflow or respective owner

Related posts about php