PHP login, getting wrong count value from query / fetch array
<p>*<em>EDIT</em>*Thanks to the comments below it has been figured out that the problem lies with the md5, without everything works as it should.<br>
But how do i implent the md5 then?</p>

<p>I am having some troubles with the following code below to login.<br>
The database and register system are already working.<br>
The problem lies that it does not find any result at all in the query.<br>
IF the count is > 0 it should redirect the user to a secured page.<br>
But this only works if i write count >= 0, but this should be > 0 , only if the user name and password is found he should be directed to the secure (startpage) of the site after login.<br>
For example root (username) root (password) already exists but i cannot seem to properly login with it.</p>

<pre><code>&lt;?php
session_start();

if (!empty($_POST["send"]))
{   
$username = ($_POST["username"]);
$password = (md5($_POST["password"])); 
$count = 0;

$con = mysql_connect("localhost" , "root", "");

mysql_select_db("testdb", $con);

$result = mysql_query("SELECT name, password FROM user WHERE name = '".$username."' AND password = '".$password."' ")
    or die("Error select statement");


$count = mysql_num_rows($result);


if($count &gt; 0) // always goes the to else, only works with &gt;=0 but then the data is not found in the database, hence incorrect
{
    $row = mysql_fetch_array($result);

    $_SESSION["username"] = $row["name"];
    header("Location: StartPage.php");
}
else
{
    echo "Wrong login data, please try again";
}

mysql_close($con);    
}

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