peppiv has asked for the wisdom of the Perl Monks concerning the following question:
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 WH +ERE date_col = ?'); $sth->execute($date) or die $sth->errstr; while (my $types = $sth->fetchrow_array()) { if ($spread_2 >= $ty +pes){$spread_2 = $types} if ($spread >= $types){$spread = $types} print qq(<p style="margin-left: 0; margin-top: 20"><font size="2" + face="Arial"><b>There are $types applications with $date listed as ' +Date Applied'.<br>Results $spread - $spread_2 shown.</b></font></p>); } $sth->finish(); print qq($table); print qq($table_headers); my $sth = $dbh->prepare('SELECT * FROM applicant WHERE date_col = + ? ORDER BY job_position LIMIT ?,10'); $sth->execute($date,$limit) or die $sth->errstr; while (my @result = $sth->fetchrow_array()) { print qq(<tr><td>$result[0], $result[1]</td></tr>\n); } print qq(<tr><td colspan="10"><center><form method="POST" acti +on="return.pl"><input type="hidden" name="limit_3" value="10"><input +type="hidden" name="limit" value="$limit"><input type="hidden" name=" +date_year" value="$date_year"><input type="hidden" name="date_month" +value="$date_month"><input type="hidden" name="date_day" value="$date +_day"><input type="submit" name="action" value="Next"></form></center +></td></tr>); print qq(</table>); $sth->finish(); $dbh->disconnect; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Trouble updating value of variable for a placeholder
by thor (Priest) on Jun 16, 2002 at 04:02 UTC | |
by peppiv (Curate) on Jun 18, 2002 at 12:48 UTC | |
|
Re: Trouble updating value of variable for a placeholder
by stajich (Chaplain) on Jun 14, 2002 at 16:50 UTC | |
by peppiv (Curate) on Jun 14, 2002 at 17:05 UTC | |
by stajich (Chaplain) on Jun 14, 2002 at 18:06 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |