所以这里是我从数据库中获取当前信息的地方......
$ci = $currentinfo->fetchAll(PDO::FETCH_ASSOC);
这是我从过去一周获得一些信息的地方...
$pi = $pastinfo->fetchAll(PDO::FETCH_ASSOC);
现在我需要一个foreach
将所有信息放入 PHP 邮件函数的语句。类似这样的东西...
foreach ($ci as $civalue) {
foreach($pi as $pivalue)
$result1 = $ci["info1"]-$pi["info1"];
$result2 = etc...
$body = $result1, etc...;
$to = '$civalue["email"]';
$subject = 'Weekly Recap';
$headers = 'From: noreply@gmail.com';
mail($to, $subject, $body, $headers);