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


PHP SqlHelper类代码示例

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


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

示例1: recordFail

function recordFail($xml)
{
    $sql = "INSERT INTO tbl_rp_fail(return_code, return_msg, result_code,err_code,err_code_des,mch_billno,mch_id,wxappid,re_openid,total_amount)VALUES(\r\n'{$xml->return_code}','{$xml->return_msg}','{$xml->result_code}','{$xml->err_code}','{$xml->err_code_des}','{$xml->mch_billno}','{$xml->mch_id}','{$xml->wxappid}','{$xml->re_openid}',{$xml->total_amount}\r\n);";
    $sh = new SqlHelper();
    $sh->connDataBase(DB_WX_URL, DB_WX_USER, DB_WX_PWD, DB_WX_NAME);
    return $sh->modify($sql);
}
开发者ID:jinglikeblue,项目名称:jyhd,代码行数:7,代码来源:test_xml.php

示例2: addMessage

function addMessage($sender,$getter,$con) {
//创建SQL语句
$sql="insert into messages (sender,getter,content,sendTime) values('$sender','$getter','$con',now())";
file_put_contents("/Library/WebServer/Documents/ajax/mylog.txt",$sql."\r", FILE_APPEND);
$sqlHelper=new SqlHelper();
 return $sqlHelper->execute_dml($sql);
}
开发者ID:huang303513,项目名称:WebDevelopStudy,代码行数:7,代码来源:MessageService.class.php

示例3: ChangePassword

 public function ChangePassword($username, $oldPassword, $newPassword)
 {
     $result = false;
     $sql = "select password from t_admin where username='{$username}'";
     //创建一个SqlHelper对象
     $sqlHelper = new SqlHelper();
     $res = $sqlHelper->execute_dql($sql);
     if ($row = mysql_fetch_assoc($res)) {
         //比对密码
         if (md5($oldPassword) == $row['password']) {
             $sql = "update t_admin set password='" . md5($newPassword) . "' where username='{$username}'";
             if ($sqlHelper->execute_dml($sql) != 0) {
                 $result = true;
             } else {
                 $this->errMessage = "更新失败!";
             }
         } else {
             $this->errMessage = "原始密码不正确";
         }
     }
     //资源
     mysql_free_result($res);
     //关闭链接
     $sqlHelper->close_connect();
     return $result;
 }
开发者ID:otkinlife,项目名称:MyPhalcon,代码行数:26,代码来源:AdminService.class.php

示例4: showMessageByPage

 public function showMessageByPage($fenyePage, $loginname)
 {
     $sql = "select *from message where getter = '" . $loginname . "'" . "limit " . $fenyePage->pageSize * ($fenyePage->page - 1) . "," . $fenyePage->pageSize;
     $sqlHelper = new SqlHelper();
     $res = $sqlHelper->execute_dql2($sql);
     return $res;
 }
开发者ID:JimChenAnother,项目名称:notebook,代码行数:7,代码来源:messageModel.class.php

示例5: 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

示例6: 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

示例7: updateEmpUI

 public function updateEmpUI($id, $name, $grade, $email)
 {
     $sql = "update emp set name='{$name}',grade={$grade},email='{$email}' where id={$id}";
     $sqlHelper = new SqlHelper();
     $res = $sqlHelper->execute_dml($sql);
     $sqlHelper->close_connect();
     return $res;
 }
开发者ID:jimmyZRone,项目名称:test-ssh-key,代码行数:8,代码来源:empService.class.php

示例8: getStuListByPage

 public function getStuListByPage($pageNow, $pageSize)
 {
     $sql = "select * from student limit " . ($pageNow - 1) * $pageSize . ",{$pageSize}";
     $sqlHelper = new SqlHelper();
     $res2 = $sqlHelper->execute_dql2($sql);
     //free
     return $res2;
 }
开发者ID:EricWenyi,项目名称:Member-Management-System,代码行数:8,代码来源:StuService.class.php

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: getId

 public function getId($tel)
 {
     $sqlHelper = new SqlHelper();
     $user = new User();
     $sql = "select id from user where tel='{$tel}'";
     $res = $sqlHelper->dql_arr($sql);
     $user->setId($res[0]['id']);
     return $user;
 }
开发者ID:justfu,项目名称:lavender,代码行数:9,代码来源:UserService.class.php

示例14: 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

示例15: getFenyePage

 /**
  * @param $fenyePage
  */
 function getFenyePage($fenyePage)
 {
     $sqlhelper = new SqlHelper();
     $sql1 = "select * from emp limit " . ($fenyePage->pageNow - 1) * $fenyePage->pageSize . "," . $fenyePage->pageSize;
     echo "当前页:" . $fenyePage->pageNow . "<br/>";
     echo $sql1;
     $sql2 = "select count(id) from emp";
     $sqlhelper->exectue_dql_fenye($sql1, $sql2, $fenyePage);
     $sqlhelper->close_conn();
 }
开发者ID:blackjack0922,项目名称:empManage,代码行数:13,代码来源:EmpService.class.php


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