In cassandra you cant just query a 'table' as you would normally. You need to set up secondary indexes for every column you might want to query.
Say we have a table:
key | User | Age
----------+----------------
phpqa | Jack | 20
You can query directly on the key:
SELECT * FROM User WHERE key='phpqa';
But to carry out other WHERE queries you'd need a secondary index on the columns you want to have available in the WHERE clause.
What can you do to make your querying flexible in the way that you desire:
- Secondary indexes as described above.
- Use composite columns as your key. Its a good idea if you only have 2-3 columns you want to query, but have a read through this article detailing how and when to use composite keys, and here is a link in how to implement it in phpcassa.