PHP Forum

Problem assigning value to variable in "IF" function

Does this script makes sense? I am trying to take the value that is set to "authenticat" and write it to authentication.

Advertisement
I think it is getting messes up by the $authenticat = "1" part.

Thanks
function check_username_pin($USERID, $PIN)
{
Advertisement
$query="SELECT id FROM users WHERE ( userid = '$USERID' AND pin = '$PIN' )";
// dont return pin because of hackers
$result=mysql_query($query);
if(mysql_num_rows($result)>0)
{
Advertisement
$authenticat = "1"
}
$query="SELECT id FROM users WHERE ( useris = '$USERID' )";
// dont return pin because of hackers
$result=mysql_query($query);
if(mysql_num_rows($result)==0)
{
$authenticat = "2"; // bad id
}
$query="SELECT id FROM users WHERE ( pin = '$PIN' )";
// dont return pin because of hackers
$result=mysql_query($query);
if(mysql_num_rows($result)==0)
{
$authenticat = "3"; //bad pin
}
}

write("SET VARIABLE authentication $authenticat");
Advertisement

0 answers

No answers posted yet. Be the first to answer.

Your answer

Login to answer

Trending today: see what people are reading