我有以下代码计算每月发送的消息数量。可以改成每天吗?我尝试了许多更改,但都没有成功。有什么建议么?非常感谢您!我对 PHP/MySQL 还很陌生。另外,我知道当前的 MySQL 查询已被弃用!:
$vmYear = date("Y");
$vmMonth = date("m");
$vmfromdate = mktime(0,0,0,$vmMonth,"1",$vmYear);
$vmtodate = mktime(0,0,0,$vmMonth,"31",$vmYear);
$verifmessagespermonth = mysql_query("SELECT ID FROM messages WHERE msg_from = '$session_memberid' AND ( time BETWEEN '$vmfromdate' AND '$vmtodate' )");
$nummessagesthismonth = mysql_num_rows($verifmessagespermonth);
} else {
$nummessagesthismonth = 0;
}