My SQL statement is as below:

$query="select date_format(login_time,'\%Y/\%m/\%d') as d,
        service,count(*),
        sum(connect_time),sum(bytes_sent),sum(bytes_rcvd),
        sum(bytes_total),avg(bps)
        from system_logins
        where to_days(login_time) = (to_days(NOW()) -1)
        group by service,d ";

$sth = $dbh->prepare($query);
$sth->execute() or die "$dbh->errstr \n";

Thanks,
Chan Choth


Rob Dixon wrote:

> Puth Chan Choth wrote:
> > Hello all,
> >
> > Why do I get DBD::mysql::st execute failed: Got error -1 from table
> > handler at sys.pl line 40? My line 40 is:
> > $sth->execute() or die "$dbh->errstr \n";
> >
> > Thank you so much for your assistance.
>
> It's my guess that you SQL content is wrong. Please show us a little more
> of your code.
>
> Also, is your script in 'sys.pl'?
>
> Rob
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to