can someone tell me what is wrong with this php coding!?

ak24ali

New member
<?php
$username = $_POST['username'];
$password = $_POST['password'];

if ($username&&$password)
{

$connect = mysql_connect("local","root","") or die ("couldn't connect!")
mysql_select_db("phplogin") or die ("couldn't find dp!");



$query = mysql_query("SELECT * FROM users WHERE username='$username'")
$numrows = mysql_num_rows ($query);
echo $numrows
if ($numrows!=0)




{

while ($row = mysql_fetch_assoc($query))
{




$dbusername = $row['username'];
$dbpassword = $row['password'];
}
if ($username==$dbusername&&$password==$dppassword)
{
echo "your in!";
}
else
echo "incorect password";
}
else
die("please enter valid username");



{
}
}
else
die ("please enter a username and password");
?>


it just wont tell me the amount of rows and it is letting anyone onto the page (i have a form code on the previous page and a database with the password stored in and that works when i log in but it has stopped working when i put $numrows)
 
Back
Top