iluvperl
Programmer
- Jan 22, 2006
- 107
I need to know how many rows are returned that satisfy my query.
I need to know how many rows will be the result of this. The thing is, I am doing an $sth->fetch with bind_columns so I'd rather not have to do 2 separate queries if I could get away with it.
I am using Perl, and being my mysql experience is lacking I'd need an example of how to store the number in a variable.
Thank you!
Code:
my $data = qq(SELECT search, engine, time FROM searches WHERE UNIX_TIMESTAMP(DATE_SUB(CURDATE(),INTERVAL 7 DAY)) <= UNIX_TIMESTAMP(time));
I need to know how many rows will be the result of this. The thing is, I am doing an $sth->fetch with bind_columns so I'd rather not have to do 2 separate queries if I could get away with it.
I am using Perl, and being my mysql experience is lacking I'd need an example of how to store the number in a variable.
Thank you!