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

problem with running IN in where clause with array #75

Open
dileepmaurya opened this issue Jun 27, 2016 · 1 comment
Open

problem with running IN in where clause with array #75

dileepmaurya opened this issue Jun 27, 2016 · 1 comment

Comments

@dileepmaurya
Copy link

I have table structure like this

CREATE TABLE mycdb.emp_details (
    id uuid PRIMARY KEY,
    age int,
    name text
)

and try to run CQL ad below

$ids = ['388caf5e-fdef-4922-9b73-88363a28140f', '0f6a5834-7194-45a7-9755-e28b20351af7']
$rs = $connection->querySync('select * from emp_details where id in(:ids)', ['ids' => $ids]);

its throw
Cassandra\Type\Exception with message '$values should be an sequential array, associative array given. Or you can set "names_for_values" option to true.'

correct me if i am wrong right now there is no any possibility to pass array in IN clause if not could we improve that.

@CBox
Copy link

CBox commented Apr 27, 2017

try changing to:
$rs = $connection->querySync('select * from emp_details where id in(:ids)', ['ids' => $ids], null, ['names_for_values' => true]);

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