i have to show status of system to end user: so i have a set of query that show sent data in 1min,5min,hour,day,month intervals
$sentCount = new stdClass();
$sentCount->amon = $link->query("select * from row_sent where result='succes' and TIMESTAMPDIFF(SECOND, send_date , now()) < 2073600 ;")->num_rows;
$sentCount->amin = $link->query("select * from row_sent where result='succes' and TIMESTAMPDIFF(SECOND, send_date , now()) < 60 ;")->num_rows;
$sentCount->a5min = $link->query("select * from row_sent where result='succes' and TIMESTAMPDIFF(SECOND, send_date , now()) < 300 ;")->num_rows;
$sentCount->ahour = $link->query("select * from row_sent where result='succes' and TIMESTAMPDIFF(SECOND, send_date , now()) < 3600 ;")->num_rows;
$sentCount->aday = $link->query("select * from row_sent where result='succes' and TIMESTAMPDIFF(SECOND, send_date , now()) < 86400 ;")->num_rows;
but this style of code need a large time to excute how can i change it to get faster answer !?