May have found the answer! Would this do the trick?
my $total = $link_db->count ( { isFeatured => 'Yes' });
my $output;
for (1 .. 3) {
my $rand = int (rand() * $total);
$link_db->select_options ("LIMIT $rand, 1");
my $sth = $link_db->select ({ isValidated => 'Yes' });
my $link = $sth->fetchrow_hashref;
$output .= Links::SiteHTML::display ('mini_link.html', $link);
}
return $output;
Alex
www.indigoclothing.com
Indigo Clothing is a t-shirt printing company based in the UK.
Indigo Clothing | Promotional Clothing | T-Shirt Printing | Embroidery
Code:
my $link_db = $DB->table('Links'); my $total = $link_db->count ( { isFeatured => 'Yes' });
my $output;
for (1 .. 3) {
my $rand = int (rand() * $total);
$link_db->select_options ("LIMIT $rand, 1");
my $sth = $link_db->select ({ isValidated => 'Yes' });
my $link = $sth->fetchrow_hashref;
$output .= Links::SiteHTML::display ('mini_link.html', $link);
}
return $output;
Alex
www.indigoclothing.com
Indigo Clothing is a t-shirt printing company based in the UK.
Indigo Clothing | Promotional Clothing | T-Shirt Printing | Embroidery