當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DBModel::insertDB方法代碼示例

本文整理匯總了PHP中DBModel::insertDB方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBModel::insertDB方法的具體用法?PHP DBModel::insertDB怎麽用?PHP DBModel::insertDB使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DBModel的用法示例。


在下文中一共展示了DBModel::insertDB方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct($year)
 {
     if (!isset($year)) {
         $year = ContestModel::getCurrentYear();
     }
     $this->year = $year;
     $cond['id'] = $year;
     if (!DBModel::existUser('cernet_contest', $cond)) {
         DBModel::insertDB('cernet_contest', $cond);
     }
 }
開發者ID:sysuzjz,項目名稱:soya,代碼行數:11,代碼來源:ContestModel.class.php

示例2: storeAward

 /**
  * store the men and the teams in the table--second_award
  * @author panda
  */
 public function storeAward()
 {
     $year = ContestModel::getCurrentYear();
     $tables = ['cernet_user', 'cernet_team', 'cernet_teacher'];
     $model = new DBModel();
     for ($i = 0; $i < 3; $i++) {
         $users = $model->getAward($tables[$i]);
         foreach ($users as $user) {
             $data = array('user_type' => $i, 'user_id' => $user['id'], 'award' => $user['prize'], 'contest_id' => $year);
             $model->insertDB('second_award', $data);
         }
     }
 }
開發者ID:sysuzjz,項目名稱:soya,代碼行數:17,代碼來源:AdminModel.class.php

示例3: new_report_

 public function new_report_()
 {
     eval(USER);
     $data = $_POST;
     unset($data['__hash__']);
     $data['id'] = $this->generateReportId();
     DBModel::insertDB('cernet_report', $data);
     $data_['report_id'] = $data['id'];
     $cond['id'] = DBModel::getTeamByUser(session('userid'));
     DBModel::updateDB('cernet_team', $cond, $data_);
     $this->assign('waitSecond', 1);
     $this->success(Success('publish'), '__ROOT__/Index/report_list');
 }
開發者ID:sysuzjz,項目名稱:soya,代碼行數:13,代碼來源:UserAction.class.php

示例4: register_

 /**
  * Register handle function.
  * Usertype: Student
  */
 public function register_()
 {
     try {
         $this->assign('waitSecond', 2);
         $data['username'] = safepost('username');
         $pwd = safepost('password');
         if (!DBModel::existUser('cernet_user', $data) && !DBModel::existUser('second_user', $data)) {
             $data = trimarray($_POST);
             unset($data['__hash__']);
             $data['password'] = encrypt($pwd);
             $data['id'] = $this->generateStudentId();
             DBModel::insertDB('cernet_user', $data);
             $this->success(Success('register'), '__ROOT__');
         } else {
             # Error Tips
             $this->error(Error('register'), lastpage());
         }
     } catch (Exception $e) {
         throw_exception($e->getMessage());
     }
 }
開發者ID:sysuzjz,項目名稱:soya,代碼行數:25,代碼來源:IndexAction.class.php

示例5: modify_tutor_

 /**
  * Create || Modify a tutor.
  */
 public function modify_tutor_()
 {
     eval(ADMIN);
     try {
         $data["name"] = safepost("name");
         $data["mobile"] = safepost("mobile");
         $data["email"] = safepost("email");
         $cond["id"] = safepost("id");
         if ($cond['id'] != '') {
             DBModel::updateDB('cernet_tutor', $cond, $data);
         } else {
             DBModel::insertDB('cernet_tutor', $data);
             $tutor = DBModel::getByFields('cernet_tutor', $data);
             $tutor = $tutor[0];
             $cond['id'] = $tutor['id'];
             $team_id = safepost("team_id");
             DBModel::updateDB('cernet_team', $cond, array('tutor_id' => $team_id));
         }
         goback();
     } catch (Exception $e) {
         throw_exception($e->getMessage());
     }
 }
開發者ID:sysuzjz,項目名稱:soya,代碼行數:26,代碼來源:AdminAction.class.php


注:本文中的DBModel::insertDB方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。