I've a problem while getting schedules from my datebase
DB:
Schedules
ID: 1
start_time : 2014-04-04 08:00:00
and more..
The left join
//start is defined as : $start = '2014-04-04'
public function getEntriesForWebuserByDate($businessId,$userId,$date){
$select = $this->select()->setIntegrityCheck(false)
->from(array('i' => $this->_name), array('*'))
->where('i.start_time = "'.$start.'"') //Both should be dates
$select->where('(b.instance_id = ?)', $businessId);
return $select->query()->fetchAll();
}
//Note: The left join works fine I just stripped some stuff out
The problem is I want to check if start
is the same as i.start_time
but one is a date and one is a datetime.
Is there a way to convert i.start_time to a date format in the left join?
//Note: This is zend 1! And also it is built in a cms