Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
if(isset($_POST['submit'])){

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

$sql="select * from regform where u_user='".$uname."'AND u_password='".$password."' limit 1";

$result=mysql_query($sql);

if(mysql_num_rows($result)){
header("location:loginform/home.php");
echo " You Have Successfully Logged in";
exit();

}
else{
echo " You Have Entered Incorrect Password";
exit();
}

}
?>

What I have tried:

i have tried if(mysql_num_rows($result)==1){
and also i have tried if(mysql_num_rows($result)!=1){
Posted
Updated 29-Oct-18 9:56am
Comments

1 solution

Please read the MySQL documentation for the mysql_query command, this is such a common question.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900