Forum Moderators: coopster
<?php
@mysql_connect("localhost", "*****", "***") or die("Cannot connect to DB!");
@mysql_select_db("paul161_test") or die("Cannot select DB!");
$sql="SELECT email FROM users WHERE pasword=".$pasword.
and password=.$password.;
if(!$r) {
$err=mysql_error();
print $err;
exit();
}
if(mysql_affected_rows()==0){
print "no such login in the system. please try again.";
exit();
}
else{
print "successfully logged into system.";
//proceed to perform websites functionality e.g. present information to the user
}
$sql="SELECT email FROM users WHERE pasword='$pasword' and password='$password'";
$r = mysql_query($sql) or die(mysql_error()); //no if needed. However if you finish debugging change the error to some king of message
if(!mysql_num_rows($r))...
I have no idea what was wrong in your code, as I see multiple question marks? instead of something relevant
Best regards
Michal Cibor
BTW. Why do you store redundant data? (Why double password?)