Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support request: SELECT * WHERE foo IN :bar #26

Open
politsin opened this issue Apr 1, 2019 · 1 comment
Open

Support request: SELECT * WHERE foo IN :bar #26

politsin opened this issue Apr 1, 2019 · 1 comment

Comments

@politsin
Copy link

politsin commented Apr 1, 2019

Не могу понять как работь с IN
Пробовал разные варианты отсюда https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/data-retrieval-and-manipulation.html
получаю всегда Notice: Array to string conversion in FOD\DBALClickHouse\ClickHouseStatement->getTypedParam() (line 390 of vendor/friendsofdoctrine/dbal-clickhouse/src/ClickHouseStatement.php).

FOD\DBALClickHouse\ClickHouseStatement->getTypedParam('bar') (Line: 296)
FOD\DBALClickHouse\ClickHouseStatement->execute(NULL) (Line: 153)
Doctrine\DBAL\Statement->execute() (Line: 75)

Приме кода:

<?php
$bar = [1, 2, 3];
$query = $conn->prepare('SELECT **** WHERE foo IN :bar');
$query->bindValue('bar', $bar);
@koderoff
Copy link

@politsin
$bar = [1, 2, 3];
$result = $conn->fetchAll('SELECT **** WHERE foo IN (:bar)', ['bar' => $bar], ['bar' => \Doctrine\DBAL\Connection::PARAM_INT_ARRAY);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants