关于' date'的WHERE子句柱

时间:2016-08-01 14:48:08

标签: php mysql datetime phalcon

我的表格中包含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个对象?提前致谢!

0 个答案:

没有答案