This SQL statement only returns a row if the first argument in the Or clause is true. If the Second argument is true it returns false.
$Sql="SELECT * FROM tblReg WHERE ((OnlineID='$SESSION_UNAME' Or COnlineID='$SESSION_UNAME') AND FileName='Blah')";
$Result=mysql_query($Sql,$Connect);
$NumRows = mysql_num_rows($Result);
If($NumRows > 0){
$Reg = TRUE;
}else{
$Reg = FALSE;
}
If OnlineID = the Session name the $Reg returns true, but if COnlineID = the Session name and OnlineID does not then $Reg returns false. It is supposed to return true if either field = the Session name.
Is there something wrong with that SQL statement that would casue it to return the wrong value?
Thanks!๐