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

search for in the

TokyoTyrantQuery::current> <TokyoTyrantQuery::__construct
[edit] Last updated: Fri, 25 May 2012

view this page in

TokyoTyrantQuery::count

(バージョン情報なし。おそらく SVN 版にしか存在しないでしょう)

TokyoTyrantQuery::countレコードを数える

説明

public int TokyoTyrantQuery::count ( void )

クエリが返すレコードの数を返します。

パラメータ

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

返り値

マッチした行の数を返します。エラー時には TokyoTyrantException をスローします。

例1 TokyoTyrantQuery::count() の例

<?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" => "not 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");

/* 結果を数えます */
var_dump($query->count());
?>

上の例の出力は以下となります。

int(2)

参考



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

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