Got it...
I just added an IF wrapper in the middle of the function, instead of trying to limit the function before it runs. A bit neanderthal in that it probably runs clunky, but serves it's purpose.
I changed:
if(mssql_num_rows($exec)>0){
echo "\n<tr>\n\t<td colspan='2' class='searchTitle'>";
echo $sql[$cat]['display'];
echo "\n\t</td>\n</tr>";
while($result=mssql_fetch_array($exec)){
echo "\n<tr>\n\t<td class='movieName'>\n\t\t";
//echo "<a href=\"javascript:launchwin('schedule/details_film08.php?ID=".$result['FilmID']."', 'ch2', 'scrollbars=yes,width=500,height=525,left=45,top=25,screenX=45,screenY=25','mainwindow');\">".$result['Film_Title']."</a>";
echo "<a href='schedule/details_film08.php?ID=".$result['FilmID']."&bw=575&bh=500' class='jcebox' style='text-decoration:none' title='".$result['Film_Title']."'>".$result['Film_Title']."</a>";
echo "\n\t</td><td class='directorName'>";
echo $result['FirstNm']." ".$result['LastNm'];
echo "\n\t</td>";
echo "\n</tr>";
}
To
if(mssql_num_rows($exec)>0){
echo "\n<tr>\n\t<td colspan='2' class='searchTitle'>";
echo $sql[$cat]['display'];
echo "\n\t</td>\n</tr>";
while($result=mssql_fetch_array($exec)){
if ($result['CatNum']=='1'){
echo "\n<tr>\n\t<td class='movieName'>\n\t\t";
//echo "<a href=\"javascript:launchwin('schedule/details_film08.php?ID=".$result['FilmID']."', 'ch2', 'scrollbars=yes,width=500,height=525,left=45,top=25,screenX=45,screenY=25','mainwindow');\">".$result['Film_Title']."</a>";
echo "<a href='schedule/details_film08.php?ID=".$result['FilmID']."&bw=575&bh=500' class='jcebox' style='text-decoration:none' title='".$result['Film_Title']."'>".$result['Film_Title']."</a>";
echo "\n\t</td><td class='directorName'>";
echo $result['FirstNm']." ".$result['LastNm'];
echo "\n\t</td>";
echo "\n</tr>";
}
}
Basically wrapping the function in:
if ($result['CatNum']=='1'){ FUNCTION HERE }
Thanks again for everyone browsing my question, I know it's tough to figure out someone else's code sometimes.