PHP else Statement
<p>The first part of this code works fine, I just can't seem to get the <code>else</code> statment working for when <code>if ($row[password] == $password_hash)</code> is <code>false</code>. I'm sure I only have a small error somewhere but just can't seem to find it.</p>

<pre><code>list ($sessionname) = checkuser();
if (isset($_POST['save'])){

connect();

$currentpass = sha1($_POST['password']);
$newpass = sha1($_POST['password1']);

$sql = "SELECT password FROM members WHERE username = '$sessionname'";
    $result=mysql_query($sql);
    $row = mysql_fetch_array($result);

        if ($row['password'] == $currentpass)

    $query = mysql_query("UPDATE members SET password = '$newpass' WHERE username = '$_SESSION[username]'");
            $updated = "Your password has been updated";
               print_r($row);
        }else{
    $a = "Passwords do not match";
    return $b;
        }
}
</code></pre>
