Hi. I have an Sql statement that uses an Or and an AND statement and i can't figure out why it is returning a result that it shouldn't. Basically it's saying Get every row where Field1='Blah' Or Field2='Blah' AND Field3='Blah'. It returns a row even when field 3 does not = 'Blah'. Here is my code.
$Sql="SELECT * FROM tblReg WHERE OnlineID='$SESSION_UNAME' Or COnlineID='$SESSION_UNAME' AND SongName='Blah.mp3'";
$Result=mysql_query($Sql,$Connect);
$NumRows = mysql_num_rows($Result);
If($NumRows > 0){
$Test = "TRUE";
}else{
$Test = "FALSE";
}
$Test always returns TRUE even though there is no Song Named "Blah.mp3" in the database. THere is however an OnlineID that ="$SESSION_UNAME "
any idea why?
Thanks!😃