Hi
I have a global that is supposed to return a random link from the links with flag (isSponsored = Yes)
sub {
my $db = $DB->table('Links');
my $total = $db->count ( 'isValidated' => 'Yes');
my $rand = int( rand($total) );
my $cond = GT::SQL::Condition->new('isSponsored', '=', 'Yes');
$db->select_options ("LIMIT $rand, 1");
my $link = $db->select->fetchrow_hashref;
return Links::SiteHTML::display('link', $link);
}
The gloabl is returing links regardless of my condition (all over the database)
Any suggsetions?
Regards
KaTaBd
Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
I have a global that is supposed to return a random link from the links with flag (isSponsored = Yes)
sub {
my $db = $DB->table('Links');
my $total = $db->count ( 'isValidated' => 'Yes');
my $rand = int( rand($total) );
my $cond = GT::SQL::Condition->new('isSponsored', '=', 'Yes');
$db->select_options ("LIMIT $rand, 1");
my $link = $db->select->fetchrow_hashref;
return Links::SiteHTML::display('link', $link);
}
The gloabl is returing links regardless of my condition (all over the database)
Any suggsetions?
Regards
KaTaBd
Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory