Re: Is this the best way?

From: Date: Fri, 14 Mar 2008 17:02:32 +0000
Subject: Re: Is this the best way?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-271589@lists.php.net to get a copy of this message
$rowcnt = mysqli_num_rows($loginResult); if($rowcnt !="1"){
            echo "Auth failed";
            die("Auth failed... Sorry");
                              }else{
            while($row1 = mysqli_fetch_array($loginResult)) {
                $_SESSION['user'] = $row1['loginName'];
                $_SESSION['loggedin'] = "YES";
Eww. Use booleans: $_SESSION['loggedin'] = true;
                $table = $row1['tableName'];
                $adminLevel = $row1['adminLevel'];
                $authenticated = "TRUE";
Like above, I would advise using booleans (true/false) and not strings (text): $authenticated = true; // Note the lack of quote marks -- Richard Heyes Employ me: http://www.phpguru.org/cv

« previous php.general (#271589) next »