downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

TokyoTyrantQuery::hint> <TokyoTyrantQuery::count
[edit] Last updated: Fri, 25 May 2012

view this page in

TokyoTyrantQuery::current

(PECL tokyo_tyrant >= 0.1.0)

TokyoTyrantQuery::current現在の要素を返す

説明

public array TokyoTyrantQuery::current ( void )

現在の要素を返します。Iterator インターフェイスを実装したものです。

パラメータ

この関数にはパラメータはありません。

返り値

現在の行を返します。

例1 TokyoTyrantQuery のイテレータの例

<?php
/* テーブルデータベースに接続します */
$tt = new TokyoTyrantTable("localhost"1979);

/* 行を追加します */
$tt->put(null, array("column1" => "some data""column2" => "something here"));
$tt->put(null, array("column1" => "more data""column2" => "best data this far"));
$tt->put(null, array("column1" => "again data""column3" => "foobar here"));
$tt->put(null, array("column45" => "random data""column2" => "something along the lines"));
$tt->put(null, array("column21" => "test data""column2" => "generating.."));
$tt->put(null, array("column1" => "foobar data""column2" => "value here"));

/* 新しいクエリオブジェクトを取得します */
$query $tt->getQuery();

/* 検索条件を追加します */
$query->addCond("column2"TokyoTyrant::RDBQC_STROR"something");

/* 結果を反復処理します */
foreach ($query as $key => $value) {
    echo 
"pk: $key, columns: "count($value) ,"\n";
}
?>

上の例の出力は、 たとえば以下のようになります。

pk: 1, columns: 2
pk: 4, columns: 2

参考



add a note add a note User Contributed Notes TokyoTyrantQuery::current
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites