Could someone tell me how to delete the 1st record of the search I have below?
Actually, I need to delete the "oldest" comment, but because the records are added
chronologically, I think deleting the first 'found' record should suffice.
# Get our Comments db object
my $comments = $DB->table('GB_Comments');
# Do the search
$comments->select_options ('ORDER BY GB_Comment_Date ASC');
my $comments_sth = $comments->select( { GB_Comment_LinkID => '$id' } );
my $comment_hits = $comments->hits;
if($comment_hits >= $opts->{gb_max_comments})
{
$DB->table('GB_Comments')->delete(row=0);
}
Thank you
Chris
RGB World, Inc. - Software & Web Development.
rgbworld.com
Actually, I need to delete the "oldest" comment, but because the records are added
chronologically, I think deleting the first 'found' record should suffice.
# Get our Comments db object
my $comments = $DB->table('GB_Comments');
# Do the search
$comments->select_options ('ORDER BY GB_Comment_Date ASC');
my $comments_sth = $comments->select( { GB_Comment_LinkID => '$id' } );
my $comment_hits = $comments->hits;
if($comment_hits >= $opts->{gb_max_comments})
{
$DB->table('GB_Comments')->delete(row=0);
}
Thank you
Chris
RGB World, Inc. - Software & Web Development.
rgbworld.com