我正在尝试从数据库中获取所有用户信息,并检查时间戳(四天),并检查它与时间现在我有工作的时间位,但我不能让它发送到所有的时候,时间是>四天
$result1 = mysql_query("SELECT * FROM accounts") or die (mysql_error());
while ($row1 = mysql_fetch_array($result1)) {
$users_email = $row1['email'];
$user_name = $row1['user'];
$days_time = $row1['fourteendays'];
if($timenow > $days_time){
mail( $users_email, $subject, $emailbody, $headers);
echo "email sent!";
}
}发布于 2009-10-23 11:30:36
我假设您已经在脚本中的某个位置设置了'$timenow‘变量,并且我会确保在比较时检查两个时间格式是否相同。这是我过去的问题。
有关与日期相关的php信息,请访问以下链接
http://ca.php.net/manual/en/function.date.php
https://stackoverflow.com/questions/1611159
复制相似问题