当前位置: 首页>>代码示例>>PHP>>正文


PHP SqlHelper::close方法代码示例

本文整理汇总了PHP中SqlHelper::close方法的典型用法代码示例。如果您正苦于以下问题:PHP SqlHelper::close方法的具体用法?PHP SqlHelper::close怎么用?PHP SqlHelper::close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SqlHelper的用法示例。


在下文中一共展示了SqlHelper::close方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_question_gaicuo

 public function get_question_gaicuo($paper_id)
 {
     $sqlHelper = new SqlHelper();
     $sql = "select correct_name,correct_code,true_code from correct where paper_id='{$paper_id}'";
     $arr = $sqlHelper->res_array_erwei($sql);
     $sqlHelper->close();
     return $arr;
 }
开发者ID:justfu,项目名称:Microclass1.0,代码行数:8,代码来源:selectService.class.php

示例2: get_user_info

 public function get_user_info($sno)
 {
     $sqlHelper = new SqlHelper();
     $sql = "select sno,usernc,truename,email,tel,major,img from student where sno='{$sno}'";
     $res = $sqlHelper->res_array($sql);
     $sqlHelper->close();
     return $res;
 }
开发者ID:justfu,项目名称:Microclass1.0,代码行数:8,代码来源:student.class.php

示例3: get_reply

 public function get_reply($bbs_id)
 {
     $sqlHelper = new SqlHelper();
     $sql = "select * from reply where bbs_id={$bbs_id}";
     $res = $sqlHelper->res_array_erwei($sql);
     $sqlHelper->close();
     return $res;
 }
开发者ID:justfu,项目名称:Microclass1.0,代码行数:8,代码来源:bbs.class.php

示例4: record2DB

 private function record2DB($openid, $key)
 {
     $sql = "UPDATE tbl_rbkey SET openid='{$openid}',used_date=NOW()  WHERE rb_key ='{$key}' AND openid IS NULL;";
     $st = new SqlHelper();
     $st->connDataBase(DB_URL, DB_USER, DB_PWD, DB_RBKEY);
     $result = $st->modify($sql);
     $st->close();
     return $result;
 }
开发者ID:jinglikeblue,项目名称:jyhd,代码行数:9,代码来源:rbkey.php

示例5: record2DB

 private function record2DB($openid, $qList)
 {
     $sql = "INSERT INTO tbl_feedback VALUES('{$openid}',NOW(),'{$qList['0']}','{$qList['1']}','{$qList['2']}','{$qList['3']}','{$qList['4']}','{$qList['5']}','{$qList['6']}','{$qList['7']}');";
     $st = new SqlHelper();
     $st->conn();
     $result = $st->modify($sql);
     $st->close();
     return $result;
 }
开发者ID:jinglikeblue,项目名称:jyhd,代码行数:9,代码来源:feedback.php

示例6: update

 private function update($gameId, $player_name)
 {
     $st = new SqlHelper();
     $sql = "UPDATE tbl_player SET player_name='{$player_name}',last_login_utc=UNIX_TIMESTAMP(NOW()), last_login_date = NOW() WHERE game_id={$gameId}";
     $st->conn();
     $result = $st->modify($sql);
     $st->close();
     return $result;
 }
开发者ID:jinglikeblue,项目名称:game_server_framework,代码行数:9,代码来源:user.php

示例7: CheckAdmin

 public function CheckAdmin($id, $password)
 {
     $sqlHelper = new SqlHelper();
     $sql = "select password,name from admin where id={$id}";
     $res = $sqlHelper->res_array($sql);
     if (md5($password) == $res[0]) {
         return $res[1];
         exit;
     }
     $sqlHelper->close();
     return "";
 }
开发者ID:justfu,项目名称:Microclass1.0,代码行数:12,代码来源:AdminSevice.class.php

示例8: checkStudent

 public function checkStudent($sno, $pwd)
 {
     $arr_sno = array();
     $sqlHelper = new SqlHelper();
     $sql = "select usernc,pwd,sno from student where sno='{$sno}'";
     $arr = $sqlHelper->res_array($sql);
     if ($arr[1] == md5($pwd)) {
         $arr_sno[0] = $arr[0];
         $arr_sno[1] = $arr[2];
         return $arr_sno;
         //返回用户名
         exit;
     }
     $sqlHelper->close();
     return "";
 }
开发者ID:justfu,项目名称:Microclass1.0,代码行数:16,代码来源:studentService.class.php

示例9: get_rank

 /**
  * 获取排行榜
  * @param $params
  * @param $res
  */
 public function get_rank(&$params, &$res)
 {
     $st = new SqlHelper();
     $data = array();
     $data['self'] = 1;
     $id = mysql_escape_string($params->id);
     $sql = "SELECT COUNT(*) AS position FROM tbl_user WHERE total_score > (SELECT total_score FROM tbl_user WHERE id = '%s')";
     $sql = sprintf($sql, $id);
     $st->conn();
     $result = $st->query($sql);
     $data['self'] = $result[0]['position'];
     $st->close();
     $sql = "SELECT id,name,pic,total_score FROM tbl_user ORDER BY total_score DESC LIMIT 0,20";
     $st->conn();
     $result = $st->query($sql);
     $st->close();
     $data['list'] = $result;
     $res['data'] = $data;
     return $result;
 }
开发者ID:power-pieces,项目名称:xiu_pin_pile_box,代码行数:25,代码来源:user.php

示例10: get_rank

 /**
  * 获取排行榜
  * @param $params
  * @param $res
  */
 public function get_rank(&$params, &$res)
 {
     $st = new SqlHelper();
     $data = array();
     $data['self'] = 1;
     //        $id = mysql_escape_string($params->id);
     //        $sql = "SELECT COUNT(*) AS position FROM tbl_user WHERE total_score > (SELECT total_score FROM tbl_user WHERE id = '%s')";
     //        $sql = sprintf($sql, $id);
     //        $st->conn();
     //        $result = $st->query($sql);
     //        $data['self'] = $result[0]['position'];
     //        $st->close();
     $sql = "SELECT tbl_record.id, tbl_record.game_id, name, SUM(score) AS score FROM tbl_record LEFT JOIN tbl_user ON tbl_record.id = tbl_user.id GROUP BY id,game_id ORDER BY score DESC LIMIT 0,20";
     $st->conn();
     $result = $st->query($sql);
     $st->close();
     $data['list'] = $result;
     $res['data'] = $data;
     return $result;
 }
开发者ID:power-pieces,项目名称:baby_games,代码行数:25,代码来源:user.php


注:本文中的SqlHelper::close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。