Exemplo n.º 1
0
 public function testInsertOrIgnore()
 {
     Db::init($this->conf);
     $db = Db::get('hm_blog');
     $result = $db->table('article')->autoInc('article_id')->saveBody(['article_id' => 10000, 'title' => 'test article', 'user_id' => 40, 'create_time' => time(), 'rv_content' => 2, 'cate_id' => 22, 'comment_num' => 1, 'status' => 1])->insertIgnore();
     var_dump($result);
 }
Exemplo n.º 2
0
 /**
  * Initialize database
  */
 public function initDB()
 {
     $conf = Conf::get('db.conf');
     $readonly = Conf::get('db.readonly', false);
     \wisphp\db\Db::init($conf);
     \wisphp\db\Db::setReadOnly(!!$readonly);
 }