php logging in problems?

Jyhgg Ghhghg

New member
<?php

require("connect.php");

$post_username = $_POST['username'];
$post_password = $_POST['password'];

if ($post_username&&$post_password)
{

if(strlen($post_username)>25||strlen($post_password)>15)
die("Username or password character length too long!");
else
{

//convert password to md5
$post_password = md5($post_password);

//query the database
$login = sprintf("SELECT * FROM users WHERE username='%s' AND password='%s'", mysql_real_escape_string($POST_username), mysql_real_escape_string($POST_password));

$rowcount= mysql_num_rows(mysql_query($login));
echo $post_password;
echo $post_username;
echo $rowcount;


}
}
else
die("Username and password required");
?>

Now I can see that the password and username comes out the same as in my database fileupload table users but echo $rowcount; say 0 why could this be?
 
Back
Top