my $data = qq(SELECT search, engine, time FROM searches WHERE DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= time); my $sth = $dbh->prepare($data); $sth->execute() or die $dbh->errstr; my ($search, $engine, $date); $sth->bind_columns(\$search, \$engine, \$date); while($sth->fetch) { print "$search $engine on $date
"; } #### Edit Delete 1 this is fun Google 2006-08-10 10:48:21 Edit Delete 2 oh yeah About 2006-08-10 11:15:18 Edit Delete 3 yet another About 2006-08-10 11:15:26 Edit Delete 4 this is fun Excite 2006-08-10 11:15:35 Edit Delete 5 another on this Excite 2006-08-10 11:15:44 Edit Delete 6 testing Dogpile 2006-08-10 11:15:592006-08-10 11:15:59 #### this is fun Google on 006-08-10 10:48:21