Thanks Pug dog - I think I understand what you are saying but not quite sure how to implement it - I am a perl newbie !
How would I modify this global to use the $offset to return 3 links:
my $total = $link_db->count ( { isFeatured => 'Yes' ,isValidated=>'Yes'});
my $output;
for (1 .. 3) {
my $rand = int (rand() * $total);
$link_db->select_options ("LIMIT $rand, 1");
my $sth = $link_db->select ({isFeatured=>'Yes', isValidated => 'Yes' });
my $link = $sth->fetchrow_hashref;
$output .= Links::SiteHTML::display ('mini_link', $link);
}
return $output;
Many Thanks
Alex
Indigo Clothing is a t-shirt printing company based in the UK.
Indigo Clothing | Promotional Clothing | T-Shirt Printing | Embroidery
How would I modify this global to use the $offset to return 3 links:
Code:
my $link_db = $DB->table('Links'); my $total = $link_db->count ( { isFeatured => 'Yes' ,isValidated=>'Yes'});
my $output;
for (1 .. 3) {
my $rand = int (rand() * $total);
$link_db->select_options ("LIMIT $rand, 1");
my $sth = $link_db->select ({isFeatured=>'Yes', isValidated => 'Yes' });
my $link = $sth->fetchrow_hashref;
$output .= Links::SiteHTML::display ('mini_link', $link);
}
return $output;
Many Thanks
Alex
Indigo Clothing is a t-shirt printing company based in the UK.
Indigo Clothing | Promotional Clothing | T-Shirt Printing | Embroidery