예제 #1
0
파일: TTable.php 프로젝트: uning/mall-back
 /**
  * 按id获取
  * @param $id
  * @return unknown_type
  */
 public function get($id)
 {
     $r = parent::get($id);
     $this->after_get($r);
     return $r;
 }
예제 #2
0
    }
    $start = $end;
}
echo "<pre>\n";
record_time($st);
try {
    /* Connect to a table database */
    $tt = new TokyoTyrantTable("localhost", 10000);
    record_time($st, "connect");
    echo "num of records:" . $tt->num() . "\n";
    record_time($st, "record");
    $q = $tt->getQuery();
    record_time($st, "getQuery");
    $id = rand() % 1000000 + 10;
    echo "id={$id}\n";
    $u = $tt->get($id);
    record_time($st, "get");
    $data[uniqid()] = 'new col';
    $data[uniqid()] = 'new col2';
    $uid = $tt->putCat($id, $data);
    record_time($st, "put");
    $un = $tt->get($id);
    record_time($st, "get");
    print_r($un);
    echo "u=" . $u['u'] . "\n";
    $uid = $u['u'];
    $q->addCond('u', TokyoTyrant::RDBQC_STREQ, $uid);
    $us = $q->search();
    record_time($st, "search user");
    echo 'count($us)=' . count($us) . "\n";
    $ttotal = 0;