How can the result of the RAND function in this global then sort the result by ASC.
Can this be done?
sub {
# lists categories
my $tags = shift;
my $cat_db = $DB->table('Category');
$cat_db->select_options ("ORDER BY RAND()", "LIMIT 50");
my $sth = $cat_db->select ( { CatRoot => 1}, ['Full_Name','Name'] );
my @output;
while (my $cat = $sth->fetchrow_hashref) {
$cat->{URL} = "$CFG->{build_root_url}/" . $cat_db->as_url($cat->{Full_Name}) . "/";
push @output, $cat;
}
return {catrand => \@output};
}
~ ERASER
Free JavaScripts @ Insight Eye
Can this be done?
sub {
# lists categories
my $tags = shift;
my $cat_db = $DB->table('Category');
$cat_db->select_options ("ORDER BY RAND()", "LIMIT 50");
my $sth = $cat_db->select ( { CatRoot => 1}, ['Full_Name','Name'] );
my @output;
while (my $cat = $sth->fetchrow_hashref) {
$cat->{URL} = "$CFG->{build_root_url}/" . $cat_db->as_url($cat->{Full_Name}) . "/";
push @output, $cat;
}
return {catrand => \@output};
}
~ ERASER
Free JavaScripts @ Insight Eye