I'm running a query which displays data from 2 tables. This works fine, what I'm trying to do is apply a filter on those results so that only a certain priority would be selected (A, B, C). Here's the code as it stands now, if a certain variable is set then the filter would take place,
$sql="select *, DATE_FORMAT(a_date, '%m/%d/%Y') as a_date_formatted from company, activity where c_id=a_c_id and medivas ='$poc' group by medivas";
$query=mysql_query($sql);
$numofrows = mysql_num_rows($query);
if (isset($priority)) {
$sql1="select *, DATE_FORMAT(a_date, '%m/%d/%Y') as a_date_formatted from company, activity where c_id=a_c_id and medivas ='$poc' and priority ='$priority'";
$query1=mysql_query($sql) or die(mysql_error());
}
The first query works great, but when the priority variable is set and the 2nd query is run, I get nothing, when I'm trying to get the filtered results. lso, how would I display those results to overwite those from the first query.
😕 Thanks.