Home : Products : Gossamer Links : Discussions :

Products: Gossamer Links: Discussions: Re: [irollinson] random link: Edit Log

Here is the list of edits for this post
Re: [irollinson] random link
Something like:

Code:
require GT::SQL::Condition;

my $rand = int ( rand ( $DB->table('Links')->count ) );
my @bad = qw/Adult/;
my $cond = GT::SQL::Condition( 'Category.Name', 'NOT IN', \@bad, 'Links.ID', '=', $rand );
my $link = $DB->table('Links','Category')->select($cond)->fetchrow_hashref;

Last edited by:

Paul: Aug 3, 2002, 8:57 AM

Edit Log: