當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。