Yo
Just when I thought I had this global beat, I find another problem. I just can't seem to get the following condition statement working:
my $cond = GT::SQL::Condition->new('content_url1', 'IS NOT', \'NULL');
I would like it to return only links with their 'content_url1' field filled. Below is the global I'm working on which works great except for still returning links with the 'content_url' field empty. I'm not even really sure if thats the correct way to write the statement.
If someone could offer some help or suggestions I'd greatly appricate it.
sub {
my $tags = shift;
my $link_db = $DB->table('Links');
my $limit = $tags->{Random_Limit} || 4;
my ($output, $sth, $link);
require GT::SQL::Condition;
my $cond = GT::SQL::Condition->new('content_url1', 'IS NOT', \'NULL', 'isValidated','=','Yes', 'has_content','=','Yes');
$link_db->select_options ( 'ORDER BY RAND(NOW())', "LIMIT $limit");
$sth = $link_db->select ($cond);
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('content_table', $link);
}
return $output;
}
Just when I thought I had this global beat, I find another problem. I just can't seem to get the following condition statement working:
my $cond = GT::SQL::Condition->new('content_url1', 'IS NOT', \'NULL');
I would like it to return only links with their 'content_url1' field filled. Below is the global I'm working on which works great except for still returning links with the 'content_url' field empty. I'm not even really sure if thats the correct way to write the statement.
If someone could offer some help or suggestions I'd greatly appricate it.
sub {
my $tags = shift;
my $link_db = $DB->table('Links');
my $limit = $tags->{Random_Limit} || 4;
my ($output, $sth, $link);
require GT::SQL::Condition;
my $cond = GT::SQL::Condition->new('content_url1', 'IS NOT', \'NULL', 'isValidated','=','Yes', 'has_content','=','Yes');
$link_db->select_options ( 'ORDER BY RAND(NOW())', "LIMIT $limit");
$sth = $link_db->select ($cond);
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('content_table', $link);
}
return $output;
}