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


PHP SqlHelper::dml方法代碼示例

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


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

示例1: addstudent

 public function addstudent($sno, $usernc, $truename, $pwd, $email, $tel, $major)
 {
     $SqlHelper = new SqlHelper();
     $img = rand(1, 4) . ".png";
     $sql = "insert into student values ('{$sno}','{$usernc}','{$truename}','{$pwd}','{$email}','{$tel}','{$major}','{$img}')";
     $res = $SqlHelper->dml($sql);
     $SqlHelper->close();
     return $res;
 }
開發者ID:justfu,項目名稱:Microclass1.0,代碼行數:9,代碼來源:student.class.php

示例2: insert_correct_question

 public function insert_correct_question($correct_name, $correct_code, $true_code, $run_answer, $paper_id)
 {
     $sqlHelper = new SqlHelper();
     $correct_code = str_replace("<", "\"", $correct_code);
     $correct_code = str_replace(">", "\"", $correct_code);
     $sql = "INSERT INTO `weike`.`correct` ( `correct_name`, `correct_code`, `true_code`, `run_answer`, `paper_id`) VALUES ( '{$correct_name}', '{$correct_code}', '{$true_code}', '{$run_answer}', '{$paper_id}')";
     $res = $sqlHelper->dml($sql);
     return $res;
 }
開發者ID:justfu,項目名稱:Microclass1.0,代碼行數:9,代碼來源:question.class.php

示例3: register

 public function register($user)
 {
     $sqlHelper = new SqlHelper();
     $username = $user->getUsername();
     $password = md5($user->getPassword());
     $tel = $user->getTel();
     $sql = "insert into user(username,password,tel) values ('{$username}','{$password}','{$tel}')";
     $res = $sqlHelper->dml($sql);
     $sqlHelper->close_connect();
     return $res;
 }
開發者ID:justfu,項目名稱:lavender,代碼行數:11,代碼來源:UserService.class.php

示例4: insert_question

 public function insert_question($content, $username, $sno)
 {
     $sqlHelper = new SqlHelper();
     $content = str_replace("<", "\"", $content);
     $content = str_replace(">", "\"", $content);
     $time = date('Y-m-d h:m:s');
     $sql = "insert into bbs(content,username,date) values ('{$content}','{$username}','{$time}','{$sno}')";
     $res = $sqlHelper->dml($sql);
     $sqlHelper->close();
     return $res;
 }
開發者ID:justfu,項目名稱:Microclass1.0,代碼行數:11,代碼來源:bbs.class.php

示例5: deleteallArticle

 public function deleteallArticle($arr)
 {
     $id = "";
     $sqlHelper = new SqlHelper();
     for ($i = 0; $i < count($arr); $i++) {
         if ($i < count($arr) - 1) {
             $id .= $arr[$i] . ",";
         } else {
             $id .= $arr[$i];
         }
     }
     $sql = "delete from lavender_article where id in ({$id})";
     $res = $sqlHelper->dml($sql);
     $sqlHelper->close_connect();
     return $res;
 }
開發者ID:justfu,項目名稱:lavender,代碼行數:16,代碼來源:ArticleService.class.php


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