Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cassandra Wiki" for 
change notification.

The following page has been changed by daniellockard:
http://wiki.apache.org/cassandra/ClientExamples

The comment on the change is:
updated the php example, again.

------------------------------------------------------------------------------
    $protocol = new TBinaryProtocol($transport);
    $client = new CassandraClient($protocol);
    $transport->open();
-     
+   
+   
    /* Insert some data into base attributes */
    
    // Table name specified in storage=conf.xml
@@ -54, +55 @@

  
    // Add a new column path to be altered. 
    $columnPath->column = 'age';
-   $columnPath= new cassandra_ColumnPath($columnPathArgs);
-   
    //Get a current timestamp
    $timestamp = time();
-   
    // Update the value to be inserted for the updated column Path
    $value = "24";
    $client->insert($tableName, $keyUserId, $columnPath, $value, $timestamp, 
$block_for);
@@ -70, +68 @@

    $columnParent->column_family = "base_attributes";
    $columnParent->super_column = null;
      
-   // column names to start and end slice at
+   // Start less than zero gets all results
    $start = '';
+   // Specify a range that you want to get from. -1 ignores the range. 
    $end = '';
    // Controls the sorting of the results. Booleand value
    $is_ascending = true;
@@ -80, +79 @@

    
    // Issue the Query
    $result = $client->get_slice($tableName, $keyUserId, $columnParent, $start, 
$end, $is_ascending , $count);
+   
    
    print_r($result);
    $transport->close();

Reply via email to