I have this code:
$query = Doctrine_Query::create()
->select('*')
->from('attendanceRecord a')
->where("employeeId IN (?)", implode(",", $employeeId));
$employeeId is an array of numbers
The sql output was:
Select * from attendanceRecord a where employeeId IN ('2,4,5')
but it have quote and was wrong I want this:
Select * from attendanceRecord a where employeeId IN (2,4,5)
How can I do it correctly in doctrine?
As simple as:
$query = Doctrine_Query::create()
->from('attendanceRecord a')
->whereIn('a.employeeId', $employeeId);
Please make sure you see the official documentation before asking a question.