$query = "SELECT * FROM ourfin WHERE (nextyearend < '$srch' OR nextquarter < '$srch' OR nextpfs < '$srch' OR nextbank < '$srch') AND producer='Lori' ORDER BY client";
There are a few options.
1.)You could split up the queries. Then test which one it was that worked.
2.)Or you could test each field before you print it.
1 might be considered wasteful of resources.
2 would save resources and it would be easier to implement, I think.
if($queryFieldAboutToBePrinted < $srch)
{
$HTMLOUTPUT .= "<b>" . $queryField.... . "</b>";
}
That's I would do it, based on the information you gave us.