I'm not sure why this is not working:
if($strFilterByStatus != 'all' && $strFilterByYear == 'all' && $strFilterByMonth !='all')
{
$strSQL = "SELECT * FROM tblcase where recovered = '".$strFilterByStatus."' and monthreported = '".$strFilterByMonth."'" ;
}
else if($strFilterByStatus != 'all' && $strFilterByYear != 'all' && $strFilterByMonth !='all')
{
$strSQL = "SELECT * FROM tblcase where recovered = '".$strFilterByStatus."' and yearreported = '".$strFilterByYear."' and monthreported = '".$strFilterByMonth."'" ;
}
if (mysql_num_rows($strSQL)==0)
{
$strCaseExist = false;
}
else
{
$SQL=mysql_query($strSQL);
$strCaseExist = true;
}
I have 2 different SQL statements and I just want to know if it will return a record or not.