mysql_fetch assoc refuses to return password row. Help needed
<p>The username row comes out perfectly but the password row refuses to come through. </p>

<p>I am at a loss here.</p>

<p>Does anybody know what the solution is?</p>

<p>here is my code::</p>

<pre><code>&lt;?php

//Mass include file
include ("includes/mass.php");

//This is the login script
//Grabbing the login values and storing them

$username = $_POST['username'];
$password = $_POST['password'];
$submit   = $_POST['submit'];

if (isset($submit))
{
    if (strlen($username)&lt;2) // put || ($username==(same as value on the database)
    {
        echo ("&lt;br&gt;You must enter a longer username&lt;/br&gt;");
    }
    elseif (strlen($password)&lt;=6)
    {
        echo ("&lt;br&gt;You must enter a longer password&lt;br&gt;");
    }
    else
    {
        $sql = "SELECT * FROM user WHERE username = '$username'";
        $query = mysql_query($sql);
        $numrows = mysql_num_rows($query);

        if ($numrows != 0)
        {
            while ($row = mysql_fetch_assoc($query))
                $dbusername = $row['username'];
            $dbpassword = $row['password'];         

            if ($dbusername == $username &amp;&amp; $dbpassword == $password)
            {
                echo "your in!";
            }
            else
            {
                echo "Wrong info";
            }
        }
        else
        {
            die ("That username doesnt exist");
        }
    }
}

?&gt;
</code></pre>
