$super_column->columns = array($column1, $column2); // create columnorsupercolumn holder class that batch_insert uses $c_or_sc = new cassandra_ColumnOrSuperColumn(); $c_or_sc->super_column = $super_column; // create the mutation (a map of ColumnFamily names to lists ColumnsOrSuperColumns objects $mutation['Super1'] = array($c_or_sc); $client->batch_insert($keyspace, 'KeyName', $mutation, $consistency_level); /* Query for data */ // Specify what Column Family to query against. $columnParent = new cassandra_ColumnParent(); $columnParent->column_family = "Standard1"; $columnParent->super_column = NULL; $sliceRange = new cassandra_SliceRange(); $sliceRange->start = ""; $sliceRange->finish = ""; $predicate = new cassandra_SlicePredicate(); list() = $predicate->column_names; $predicate->slice_range = $sliceRange; // We want the consistency level to be ONE which means to only wait for 1 node $consistency_level = cassandra_ConsistencyLevel::ONE; // Issue the Query $keyUserId = 1; $result = $client->get_slice($keyspace, $keyUserId, $columnParent, $predicate, $consistency_level); echo "<pre>"; var_dump($result); echo "</pre>"; $transport->close(); echo "OK"; } catch (TException $tx) { print 'TException: ' . $tx->why . ' Error: ' . $tx->getMessage() . "\n"; }