示例#1
0
 public function db()
 {
     $db = new BaseModelDB();
     $rs = $db->getData("SELECT * FROM `test`", 10);
     //$db->setTableName('test');
     //$db->update(array('name'=>'示例'), array('id'=>2));
     // $rs = $db->getRow("SELECT * FROM `test`");
     // $rs = $db->getFirst("SELECT * FROM `test`");
     header('Content-Type: text/html; charset=UTF-8');
     var_dump($rs);
 }
示例#2
0
文件: example.php 项目: az0ne/diaoyu
 * All rights reserved.
 * 示例程序
 * @author          wangxin <*****@*****.**>
 * @time            2011/3/2 15:03
 * @version         Id: 0.9
*/
require dirname(__FILE__) . "/global.php";
/*
$mcd = new MyMemcached();
$urls = array('http://baidu.com', 'http://www.google.com.hk', 'http://search.sina.com.cn');
$r = Http::multiHeader($urls);
// var_dump($r);
exit;
*/
$db = new BaseModelDB();
$rs = $db->getData("SELECT * FROM `test`", 10);
exit;
$starttime = microtime(true);
$mcd = new MyMemcached();
$a = array();
for ($i = 0; $i < 100; $i++) {
    $a['key' . $i] = $i;
}
$mcd->setMulti($a, 10);
$t1 = microtime(true) - $starttime;
$starttime = microtime(true);
$mc = new MyMemcache();
for ($i = 0; $i < 100; $i++) {
    $a['key' . $i] = $i;
    $mc->set('key' . $i, $i, 10);
}