Gossamer Forum
Quote Reply
Change Global
Hi,

Im using the following code to generate a list of random links of a specific category.
I cannot get it to grab say the last 3 for example.

This is what Ive got:

Code:
sub {
#Place a random magazine on home page
my $table = $DB->table('Links');
$table->select_options ('ORDER BY RAND() LIMIT 1');
my $link = $table->select( { 'isValidated' => 'Yes', 'isRevista' => 'Yes'} )->fetchrow_hashref;
$link = Links::SiteHTML::tags('link',$link);
my $html = Links::SiteHTML::display('link_revista_home', $link);
return $html;
}

This code works and it grabs random, Id like to get the last 3. Im always getting a fetchrow_hashref error, but dunno how to fix it.

Andy, does your multi-global thingie do this?

Thanks,

JC
Subject Author Views Date
Thread Change Global Gorospe 7218 Aug 17, 2010, 10:14 AM
Thread Re: [Gorospe] Change Global
Andy 7106 Aug 17, 2010, 10:46 PM
Thread Re: [Andy] Change Global
Gorospe 7062 Aug 18, 2010, 3:39 AM
Thread Re: [Gorospe] Change Global
Andy 7069 Aug 18, 2010, 5:02 AM
Thread Re: [Andy] Change Global
Gorospe 7042 Aug 18, 2010, 10:27 AM
Thread Re: [Gorospe] Change Global
Andy 7049 Aug 18, 2010, 11:46 AM
Thread Re: [Andy] Change Global
Gorospe 7030 Aug 18, 2010, 12:44 PM
Thread Re: [Gorospe] Change Global
Andy 7035 Aug 19, 2010, 12:38 AM
Thread Re: [Andy] Change Global
Gorospe 6990 Aug 19, 2010, 4:29 PM
Post Re: [Gorospe] Change Global
Andy 6975 Aug 19, 2010, 11:31 PM