当前位置: 首页>>代码示例>>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;未经允许,请勿转载。