I have two table: tbl_users and tbl_profiles. The tbl_users is set as default table for login. I would like that when the login account is not present in tbl_users, it will search from tbl_profiles . Here is my code but not working
// User Logging In event
function User_LoggingIn($usr, &$pwd)
{
// No match found in any table
$sql = "Select count(*) from `tbl_users` where username='$usr' and user_password ='$pwd'";
$c = ExecuteScalar($sql);
if ($c<=0)
{
$sql1 = "Select count(*) from `tbl_profile` where username='$usr'
and pass ='$pwd'";
$c1= ExecuteScalar($sql1);
if ($c1<=0)
{
//$this->setFailureMessage($c1);
return false;
}
else
{
//$this->setFailureMessage($c1);
return true;
}
}
else
{
return true;
}
}