Using SimpleCassie fine, need array or object+variables example

15 views
Skip to first unread message

gopher20

unread,
Apr 4, 2010, 11:06:42 PM4/4/10
to simpletools
I'm very new to PHP and Cassandra, but familiar with Perl and
'traditional' RDBMS. Yes, perhaps a handicap for this kind of work.

I've no problem using the various functions within SimpleCassie, e.g.

$ks = "one";
$cf = "userinfo";
$keyID = 'test1';

//establish context for this get
$result = $cassie->keyspace($ks)->cf($cf)->key($keyID);

echo '<hr>getting multiple columns<p>';

/*
* getting multiple columns
* @return - array of objects on success, null on failure
*/
$result = $cassie->column('lastname','firstname','phone')->get();
var_dump($result);

It's clear that $result is an object and not an array

Do you have any working examples of converting the object results
into a multi-dimensional array? ... or, defining a class and being
able to take the individual data items from the resulting 'get' and
being able to individually being able to access the resulting named
values?

Perhaps just posting some code that you have that is doing useful
things from a multiple-column 'get' (as above) or even getting
multiple columns from multiple rows/keys.

Sorry if this is more of a "beginner PHP" question than a SimpleCassie
question.

Thanks!

t.d.

ewiggin

unread,
Apr 9, 2010, 3:55:16 AM4/9/10
to simpletools
+1

Im waiting answer :-)

ewiggin

unread,
Apr 9, 2010, 4:09:44 AM4/9/10
to simpletools
I fond the possible solution:
http://php.html.it/articoli/leggi/3322/php-e-cassandra-interrogare-il-database/3/

$users = $cassie->key('us...@domain.com','us...@domain.com')-
>column('name')->get();
foreach ($users as $user) {
echo $user->column->value;
}

gopher20

unread,
Apr 12, 2010, 10:19:39 AM4/12/10
to simpletools
Works for me!

Sorry... been super busy and unable to reply.

Thanks ewiggin!

t.d.

On Apr 9, 4:09 am, ewiggin <gameofen...@gmail.com> wrote:
> I fond the possible solution:http://php.html.it/articoli/leggi/3322/php-e-cassandra-interrogare-il...
>
> $users = $cassie->key('u...@domain.com','us...@domain.com')->column('name')->get();

ewiggin

unread,
Apr 13, 2010, 3:44:32 AM4/13/10
to simpletools
to welcome!

bye

Reply all
Reply to author
Forward
0 new messages