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


PHP SqlHelper::close_connect方法代碼示例

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


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

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

示例2: getFenyePage

		function getFenyePage($fenyePage){
			$sqlHelper=new SqlHelper();
			$sql1="select * from empmanage limit "
			.($fenyePage->pageNow-1)*$fenyePage->pageSize.",".$fenyePage->pageSize;
			$sql2="select count(id) from empmanage"; 
			$sqlHelper->execute_dql_fenye($sql1,$sql2,$fenyePage);
			$sqlHelper->close_connect();
		}
開發者ID:uhgy,項目名稱:phppractice,代碼行數:8,代碼來源:EmpService.class.php

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

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

示例5: checkAdmin

		public function checkAdmin($id, $password) {
			
			$sql="select password, name from admin where id=$id";
			$sqlHelper = new SqlHelper();
			$res = $sqlHelper->execute_dql($sql);
			if($row=mysql_fetch_assoc($res)){
				//
				if(md5($password)==$row['password']) {
					return $row['name'];
				}
			}
			mysql_free_result($res);

			$sqlHelper->close_connect();
			return false;
		}
開發者ID:uhgy,項目名稱:phppractice,代碼行數:16,代碼來源:AdminService.class.php

示例6: checkAdmin

 public function checkAdmin($id, $password)
 {
     $sql = "select password,name from userlogin where id={$id}";
     $sqlHelper = new SqlHelper();
     $res = $sqlHelper->execute_dql($sql);
     if ($row = mysql_fetch_assoc($res)) {
         if (md5($password) == $row['password']) {
             return $row['name'];
         }
     }
     //關閉資源
     mysql_free_result($res);
     //關閉連接
     $sqlHelper->close_connect();
     return "";
 }
開發者ID:jimmyZRone,項目名稱:test-ssh-key,代碼行數:16,代碼來源:adminService.class.php

示例7: getMessage

 function getMessage($getter, $sender)
 {
     $sql = "select * from mes where getter='{$getter}' and sender='{$sender}' and state=0";
     $mesXML = "<meses>";
     $sqlHelper = new SqlHelper();
     $mesList = $sqlHelper->execute_dql2($sql);
     if (count($mesList) != 0) {
         for ($i = 0; $i < count($mesList); $i++) {
             $row = $mesList[$i];
             $mesXML .= "<id>{$row['id']}</id><sender>{$row['sender']}</sender><getter>{$row['getter']}</getter><con>{$row['content']}</con><sendTime>{$row['sendTime']}</sendTime>";
         }
         $sql = "update mes set state=1 where getter='{$getter}' and sender='{$sender}'";
         $res = $sqlHelper->execute_dml($sql);
     }
     $mesXML .= "</meses>";
     $sqlHelper->close_connect();
     return $mesXML;
 }
開發者ID:hnqing,項目名稱:xiahn,代碼行數:18,代碼來源:MessageService.class.php

示例8: chekcAdimn

 public function chekcAdimn($id, $password)
 {
     $sql = "select password,name from admin where id={$id}";
     //創建一個SqlHelper對象
     $sqlHelper = new SqlHelper();
     $res = $sqlHelper->execute_dql($sql);
     if ($row = mysql_fetch_assoc($res)) {
         //比對密碼
         if (md5($password) == $row['password']) {
             return $row['name'];
         }
     }
     //釋放資源
     mysql_free_result($res);
     //關閉鏈接
     $sqlHelper->close_connect();
     return "";
 }
開發者ID:enmeen,項目名稱:git_empManage,代碼行數:18,代碼來源:AdminService.class.php

示例9: getMessage

 function getMessage($getter, $sender)
 {
     $sql = "select * from messages where getter='{$getter}' and sender='{$sender}' and isGet=0";
     //注意此處的sql語句中sender=“$getter”;是加引號的
     //file_put_contents("C:/wamp/www/testinfo.log","sql=".$sql."\r\n", FILE_APPEND);
     $sqlhelper = new SqlHelper();
     $array = $sqlhelper->execute_dql($sql);
     //dql返回的是數組
     $mesInfo = "<mes>";
     for ($i = 0; $i < count($array); $i++) {
         $row = $array[$i];
         $mesInfo .= " <mesId>{$row['id']}</mesId>\n\t\t\t\t\t\t            <sender>{$row['sender']}</sender>\n\t\t\t\t\t\t            <getter>{$row['getter']}</getter>\n\t\t\t\t\t\t           <content>{$row['content']}</content>\n\t\t\t\t\t\t           <sendTime>{$row['sendTime']}</sendTime>";
     }
     $mesInfo .= "</mes>";
     $sqll = "update messages set isGet=1 where getter='{$getter}' and sender='{$sender}'";
     // file_put_contents("C:/wamp/www/testinfo.log","sql=".$sql."\r\n", FILE_APPEND);
     $sqlhelper->execute_dml($sqll);
     //file_put_contents("C:/wamp/www/testinfo.log", $mesInfo."\r\n",FILE_APPEND);
     $sqlhelper->close_connect();
     return $mesInfo;
 }
開發者ID:flyweiing,項目名稱:chatroom,代碼行數:21,代碼來源:MessageService.class.php

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

示例11: QueryAllNation

 function QueryAllNation()
 {
     $sql = "select nationId,nationName from t_Nation";
     $sqlHelper = new SqlHelper();
     $res = $sqlHelper->execute_dql2($sql);
     // 關閉連接
     $sqlHelper->close_connect();
     return $res;
 }
開發者ID:otkinlife,項目名稱:MyPhalcon,代碼行數:9,代碼來源:NationService.class.php

示例12: Useraddemp

 function Useraddemp($id, $name, $password)
 {
     //做一個$sql語句
     $sql = "insert into admin (id,name,password) values('{$id}','{$name}',md5('{$password}'))";
     //同sqlHelper完成添加
     $sqlHelper = new SqlHelper();
     $res = $sqlHelper->execute_dml($sql);
     $sqlHelper->close_connect();
     return $res;
 }
開發者ID:enmeen,項目名稱:git_empManage,代碼行數:10,代碼來源:EmpService.class.php

示例13: get_affiliate_ck

            $sqlhelper->execute_dql("update ydcom_users set user_money={$user_money} where user_id={$b2}");
            //write_affiliate_log($oid, $up_uid, $row['user_name'], $setmoney, $setpoint, $separate_by);
            write_affiliate_log($oid, $b2, $user_name, $f2, 0, 0);
            $time = time();
            $fyj = "分傭金";
            $sqlhelper->execute_dql("insert into ydcom_account_log(user_id,user_money,frozen_money,rank_points,pay_points,change_time,change_desc,change_type) values({$b2},{$f2},0,0,0,{$time},{$fyj},2)");
        } else {
            break;
        }
        $a2 = $b2;
        //b2就是上家id
        $b2 = $sqlhelper->execute_dql1("select parent_id from ydcom_users where user_id={$a2}");
    }
    echo "恭喜分成成功";
    $sqlhelper->execute_dql("update ydcom_order_info set is_separate=1 where order_id={$order_id}");
    $sqlhelper->close_connect();
}
function get_affiliate_ck()
{
    $affiliate = unserialize($GLOBALS['_CFG']['affiliate']);
    empty($affiliate) && ($affiliate = array());
    $separate_by = $affiliate['config']['separate_by'];
    $sqladd = '';
    if (isset($_REQUEST['status'])) {
        $sqladd = ' AND o.is_separate = ' . (int) $_REQUEST['status'];
        $filter['status'] = (int) $_REQUEST['status'];
    }
    if (isset($_REQUEST['order_sn'])) {
        $sqladd = ' AND o.order_sn LIKE \'%' . trim($_REQUEST['order_sn']) . '%\'';
        $filter['order_sn'] = $_REQUEST['order_sn'];
    }
開發者ID:jianhuaixie,項目名稱:yundds,代碼行數:31,代碼來源:affiliate_ck.php

示例14: QueryAllStudentInfo

 function QueryAllStudentInfo()
 {
     $sql = "select zkzh,name from t_StudentInfo";
     $sqlHelper = new SqlHelper();
     $res = $sqlHelper->execute_dql2($sql);
     // 關閉連接
     $sqlHelper->close_connect();
     return $res;
 }
開發者ID:otkinlife,項目名稱:MyPhalcon,代碼行數:9,代碼來源:StudentInfoService.class.php

示例15: SqlHelper

<?php

include "./mysql.php";
include "./message.php";
session_start();
if ($_REQUEST['account'] != "") {
    $account = $_REQUEST['account'];
    $password = $_REQUEST['password'];
    $SqlHelper = new SqlHelper();
    $sql = 'select * from ims_xingfit_merchant_user where account = "' . $account . '" and password = "' . $password . '"';
    $res = $SqlHelper->pdo_fetch($sql);
    if ($res['merchantId'] != "") {
        $_SESSION['merchantId'] = $res['merchantId'];
        $sql2 = 'select * from ims_xingfit_merchant_info where merchantId = "' . $_SESSION['merchantId'] . '"';
        $res2 = $SqlHelper->pdo_fetch($sql2);
        $_SESSION['logo'] = $res2['merchantLogo'];
        $_SESSION['username'] = $res2['merchantName'];
        include "./navigation.html";
    } else {
        message('用戶名或密碼錯誤', './login.html', 'error');
    }
    $SqlHelper->close_connect();
} else {
    include "./navigation.html";
}
開發者ID:xingfit,項目名稱:xingfitPT,代碼行數:25,代碼來源:login.php


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