我有以下语法:
function get_outstandingchecking($db)
{
$result = $db->query(" SELECT distinct(haulier) as haulier from v2loads where adminstatus='captured' and DATEDIFF(now(), capturedate) >4 group by haulier,DATEDIFF(now(), capturedate) order by DATEDIFF(now(), capturedate) desc ");
return $result;
}
$outstandingchecking = get_outstandingchecking($db);
$outstandingchecking_row_count = $outstandingchecking->rowCount();
if ($outstandingchecking_row_count > 0) {
$i=0;
foreach ($outstandingchecking as $instance) {
echo $instance[$i];
$i=$i+1;
//syntax email relevent haulier
}
}
$result 查询获取受影响的值(运输者)数组。然后,我想使用每个返回的“运输者”并向他们发送电子邮件通知。
输出只显示查询结果中的第一个值,我怎样才能让它显示所有值作为 foreach 循环的一部分?
一如既往地感谢,