导致此错误的原因是什么?
遇到PHP错误 严重性:通知
消息:未定义的变量:ride_per_m
$query = $this->db->query("SELECT YEAR(book_date_time) AS y,
MONTH(book_date_time) AS m, count(id) AS count FROM `bookings` WHERE
status=6
AND YEAR(book_date_time) = YEAR(CURDATE()) GROUP BY y,m");
if($query){
foreach($query->result() as $row)
{
for($i=1;$i<=12;$i++){
if($row->m==$i)
{
if($row->count!=0 || $row->count!=NULL){
$ride_per_m[$i]=$row->count;
}
else{
$ride_per_m[$i]=0;
}
}
else{
$ride_per_m[$i]=0;
}
}
}
}
$push_ride_per_m=implode(',',$ride_per_m);