How to stop both echos appearing (php)
<pre><code>while ($stmt-&gt;fetch()) {
    if ($teacherusername == $dbTeacherUsername &amp;&amp; $teacherpassword == $dbTeacherPassword) {
        if ($dbActive == 1) {
            $loggedIn = true;
        } else if ($dbActive == 0) {
            $loggedIn = false;
            echo "You Must Activate Your Account from Email to Login";
        }
    }
}

if ($loggedIn == false &amp;&amp; $_POST) {
    echo "The Username or Password that you Entered is not Valid. Try Entering it Again";
}
</code></pre>

<p>In the code above, I have a problem displaying a message and I cannot seem to figure out what I am doing wrong. If the user enters in either the wrong password or username, then it displays the message </p>

<p><code>"The Username or Password that you Entered is not Valid. Try Entering it Again"</code>. </p>

<p>This is fine, but if the <code>$dbActive</code> = 0, it should only display the message </p>

<p><code>You Must Activate Your Account from Email to Login</code>. </p>

<p>But instead it is displaying both messages when this happens so it instead displays </p>

<p><code>You Must Activate Your Account from Email to LoginThe Username or Password that you Entered is not Valid. Try Entering it Again</code>.</p>

<p>I know why this is happening, but I cannot seem to figure it out. How can I stop it from getting both messages to be displayed if <code>$dbActive</code> = 0?</p>
