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:
#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
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