我的表格中包含date
类型的列。在我的脚本中,我生成date
数组,如下所示:
$date2 = date('Y-d-m', strtotime($date2));
for ($i = 0; $i <= 7; $i++)
{
$date1 = str_replace('-', '/', $date2);
$tomorrow = date('Y-d-m',strtotime($date1 . "+".$i." days"));
echo 'counted date : '.$tomorrow.PHP_EOL ;
array_push($dates, $tomorrow);
}
得到以下输出:
counted date : 2016-01-08
counted date : 2016-02-08
counted date : 2016-03-08
counted date : 2016-04-08
counted date : 2016-05-08
counted date : 2016-06-08
counted date : 2016-07-08
counted date : 2016-08-08
我也有Phalcon表达:
$status1 = $app
->modelsManager
->executeQuery("
SELECT *
FROM MastersFullTime
WHERE MastersFullTime.date = :date:
AND MastersFullTime.master_id = :master_id:"
,
array(
'date' => $date ,
'master_id' => $master_id
)
);
但WHERE MastersFullTime.date = :date:
无效。如何比较date
个对象?提前致谢!