I get error: Syntax error, unexpected token COMMA, near to 'col2) IN (("4081","8510"),("8510","4081"),...
My PHP-code:
$where = [];
foreach ($ids as $item) {
$where[] = '("' . $item['col1'] . '","' . $item['col2'] . '")';
}
$sql = 'SELECT * FROM ' . Models\LocalRoute::class . ' WHERE (col1,col2) IN (' . implode(',', $where) . ')';
$di->get('modelsManager')->executeQuery($sql);
I get sql:
SELECT * FROM App\Models\LocalRoute WHERE (col1,col2) IN (("4081","8510"),("8510","4081"),("4081","3845"),("5563","3845"),("3505","3845"),("3845","5563"),("3845","4081"))
Why phalcon can't execute this code?