Hi,
I am using the below global to display the 5 most popular links based on Hits which works fine.
My question is how can I modify it to only include links that have:
1. Add_Date equal to today
2. isNew = "Yes"
The two should of course not be combined - ie. two different globals.
my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY Hits DESC', 'LIMIT 5');
my $sth = $table->select;
my @output;
while (my $link = $sth->fetchrow_hashref) {
push (@output, $link);
}
return { top5_loop => \@output };
}
Cheers
Klaus
http://www.ameinfo.com
I am using the below global to display the 5 most popular links based on Hits which works fine.
My question is how can I modify it to only include links that have:
1. Add_Date equal to today
2. isNew = "Yes"
The two should of course not be combined - ie. two different globals.
Code:
sub { my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY Hits DESC', 'LIMIT 5');
my $sth = $table->select;
my @output;
while (my $link = $sth->fetchrow_hashref) {
push (@output, $link);
}
return { top5_loop => \@output };
}
Cheers
Klaus
http://www.ameinfo.com