sub DoSearchDate { my $dbh = DBI->connect('DBI:mysql:hr_db','usr','pword'); my $date_year = param("date_year"); my $date_month = param("date_month"); my $date_day = param("date_day"); my $date = ("$date_year-$date_month-$date_day"); my $types = ("\$types"); my $shade = ("\$shade"); my $default = '#E0E0E0'; my $default2 = '#FFFFFF'; my $fav = ("\$fav"); my $something = ("Top Candidate"); my $limit_3 = param("limit_3"); my $limit = param("limit"); $limit = ($limit_3 + $limit); my $spread = ($limit + 1); my $spread_2 = ($limit + 10); my $sth = $dbh->prepare('SELECT COUNT(date_col) FROM applicant WHERE date_col = ?'); $sth->execute($date) or die $sth->errstr; while (my $types = $sth->fetchrow_array()) { if ($spread_2 >= $types){$spread_2 = $types} if ($spread >= $types){$spread = $types} print qq(
There are $types applications with $date listed as 'Date Applied'.
Results $spread - $spread_2 shown.