iluvperl
Programmer
- Jan 22, 2006
- 107
Code:
my $dbh = DBI->connect("DBI:mysql:$dbase", $mysql_user, $mysql_pass) or
print DBI->errstr;
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<br>";
}
only prints out one record when there are 6 in total that should be printing and I can't for the life of me figure out WHY it's ignoring the other ones that match the time.<p>
This is a copy/paste from PHPMyAdmin in cpanel
Code:
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
Can anyone help me figure out why it's not drawing back all applicable records?