'$backdate')"; $sort="date desc"; } if ($field != "") { $fieldquery = "and ($field like '%$contains%')"; } if ($s_owner != '') { $ownerquery = "and s_owner like '$s_owner'"; } $andquery = "$fieldquery ORDER by $sort"; $tablequery = "and (table_on = $table_on)"; PRINT ""; PRINT ""; if($aquery) { $query=stripslashes($aquery); } else { $query = "SELECT * FROM checklist WHERE 1 $andquery"; } ?>