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