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


PHP SqlHelper::execute_dql方法代碼示例

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


在下文中一共展示了SqlHelper::execute_dql方法的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: getEmpListByPage

 function getEmpListByPage($pageNow, $pageSize)
 {
     $strNum = ($pageNow - 1) * $pageSize;
     $sql = "select * from emp limit {$strNum},{$pageSize}";
     $sqlHelper = new SqlHelper();
     $re = $sqlHelper->execute_dql($sql);
     //        $sqlHelper->close_conn();
     return $re;
 }
開發者ID:blackjack0922,項目名稱:empManage,代碼行數:9,代碼來源:EmpService.class.php

示例3: getPageCount

 public function getPageCount($pageSize)
 {
     $sql = "select count(id) from student";
     $sqlHelper = new SqlHelper();
     $res = $sqlHelper->execute_dql($sql);
     //calcute
     if ($row = mysql_fetch_row($res)) {
         $pageCount = ceil($row[0] / $pageSize);
     }
     //free
     return $pageCount;
 }
開發者ID:EricWenyi,項目名稱:Member-Management-System,代碼行數:12,代碼來源:StuService.class.php

示例4: 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 = mysqli_fetch_assoc($res)) {
         if (md5($password) == $row['password']) {
             return true;
         }
     }
     mysqli_free_result($res);
     $sqlhelper->close_conn();
     return false;
 }
開發者ID:blackjack0922,項目名稱:empManage,代碼行數:14,代碼來源:AdminService.class.php

示例5: getPagecount

 public function getPagecount($pagesize)
 {
     $sql = "select count(id) from emp";
     $sqlHelper = new SqlHelper();
     $res = $sqlHelper->execute_dql($sql);
     if ($row = mysql_fetch_row($res)) {
         $pagecount = ceil($row[0] / $pagesize);
     }
     //關閉資源
     mysql_free_result($res);
     //關閉連接
     $sqlHelper->close_connect();
     return $pagecount;
 }
開發者ID:jimmyZRone,項目名稱:test-ssh-key,代碼行數:14,代碼來源:empService.class.php

示例6: getPageCount

 function getPageCount($pageSize)
 {
     //查詢rowcout
     $sql = "select count(id) from brand_wyeth_customer";
     $sqlhelper = new SqlHelper();
     $res = $sqlhelper->execute_dql($sql);
     //計算pagecount
     if ($row = mysql_fetch_row()) {
         $pagecount = ceil($row[0] / $pageSize);
     }
     //釋放資源關閉鏈接
     mysql_free_result($res);
     mysql_close();
     return $pagecount;
 }
開發者ID:chijie,項目名稱:emp,代碼行數:15,代碼來源:EmpService.php

示例7: getPageCount

 function getPageCount($pageSize)
 {
     //需要查詢$rowCount
     $sql = "select count(id) from emp";
     $sqlHelper = new SqlHelper();
     $res = $sqlHelper->execute_dql($sql);
     //這樣就可以計算$pageCount
     if ($row = mysql_fetch_row($res)) {
         $pageCount = ceil($row[0] / $pageSize);
     }
     //釋放資源關閉鏈接
     mysql_fetch_row($res);
     $sqlHelper->close_connect();
     return $pageCount;
 }
開發者ID:enmeen,項目名稱:git_empManage,代碼行數:15,代碼來源:EmpService.class.php

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

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

示例10: checkAdmin

 public function checkAdmin($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($free);
     //????
     $sqlHelper->close_connect();
     return false;
 }
開發者ID:EricWenyi,項目名稱:Member-Management-System,代碼行數:18,代碼來源:AdminService.class.php

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

示例12: SqlHelper

$sqlHelper = new SqlHelper();
echo '<div class="header" style="height: 50px; position: absolute; background-color: black; width: 100%;">
					
					<a href="javascript:" class="user" target="contentFrame" style="float:right; margin-right:20px; margin-top:-1px; "><img src="images/user.png" title="用戶設置" ></a>
					<a href="api/search.php" target="contentFrame" style="float:right; margin-right:10px; "><img src="images/search15.png" title="搜索"></a>
					<span style="float:right; font-size:13px; margin-top:25px; margin-right:25px;">歡迎,';
echo $username;
echo '!</span>
				</div>
				<div class="container demo-1">
					
					<div class="column">';
for ($j = 1; $j <= 6; $j++) {
    for ($m = 1; $m <= 6; $m++) {
        $sql = "select id,name from sys where jizu={$j} and mainsys={$m}";
        $res[$j][$m] = $sqlHelper->execute_dql($sql);
        $row_cnt[$j][$m] = $res[$j][$m]->num_rows;
        $height[$j][$m] = ($row_cnt[$j][$m] / 4 + 2) * 50;
    }
}
for ($m = 7; $m <= 9; $m++) {
    $sql = "select id,name from sys where jizu=7 and mainsys={$m}";
    $res[7][$m] = $sqlHelper->execute_dql($sql);
    $row_cnt[7][$m] = $res[7][$m]->num_rows;
    $height[7][$m] = ($row_cnt[7][$m] / 4 + 2) * 50;
}
echo "<div id='dl-menu' class='dl-menuwrapper'>\n\t\t\t\t<button class='dl-trigger'>Open Menu</button>\n\t\t\t\t<ul class='dl-menu'>";
//1號機
echo "<li>\n\t\t\t\t\t\t<a href='#'>1號機</a>\n\t\t\t\t\t\t<ul class='dl-submenu'>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<a href='#'>1號鍋爐</a>\n\t\t\t\t\t\t\t\t<ul class='dl-submenu' style='width:1000px; height:";
print $height[1][1];
echo "px;'>";
開發者ID:lampdhp,項目名稱:ledger-manager,代碼行數:31,代碼來源:test1.php

示例13: realpath

<body>
    

<?php 
$file_to_require = realpath('api/SqlHelper.class.php');
//require "api/SqlHelper.class.php";
require_once $file_to_require;
//header("content-type:text/html;charset=utf-8");
$eid = $_GET['eid'];
//echo $e_sys;
$sqlHelper = new SqlHelper();
$sql_bp = "select * from beipin where eid={$eid}";
$sql_title = "select * from equipments where id={$eid}";
$sql_sg = "select * from shigu where eid={$eid}";
//$sql_lbj="select * from lingbujian where eid=$eid";
$res = $sqlHelper->execute_dql($sql_bp);
$res_title = $sqlHelper->execute_dql($sql_title);
$res_sg = $sqlHelper->execute_dql($sql_sg);
//$res_lbj= $sqlHelper->execute_dql($sql_lbj);
$title = $res_title->fetch_row();
echo '
		<div>
		<a href="equipment.php?sys=' . $title[2] . '" style="font-size:10px; " ><<返回列表</a>
        <h2>';
echo $title[1];
echo '</h2>
    </div>
	
    <div class="nTab">
        <!-- 標題開始 -->
        <div class="TabTitle">
開發者ID:lampdhp,項目名稱:ledger-manager,代碼行數:31,代碼來源:content1.php

示例14: exportExcel

            $eid = $xls->sheets[0]['cells'][$i][4];
            $data_values .= "('{$name}','{$type}',{$num},{$eid}),";
        }
        $data_values = substr($data_values, 0, -1);
        //去掉最後一個逗號
        $query = $sqlHelper->execute_dml("insert into beipin (name,type,num,eid) values {$data_values}");
        //批量插入數據表中
        if ($query) {
            echo '導入成功!';
        } else {
            echo '導入失敗!';
        }
    }
} elseif ($action == 'export') {
    //導出XLS
    $result = $sqlHelper->execute_dql("select * from student");
    $str = "姓名\t性別\t年齡\t\n";
    $str = iconv('utf-8', 'gb2312', $str);
    while ($row = $result->fetch_array()) {
        $name = iconv('utf-8', 'gb2312', $row['name']);
        $sex = iconv('utf-8', 'gb2312', $row['sex']);
        $str .= $name . "\t" . $sex . "\t" . $row['age'] . "\t\n";
    }
    $filename = date('Ymd') . '.xls';
    exportExcel($filename, $str);
}
function exportExcel($filename, $content)
{
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Content-Type: application/vnd.ms-execl");
    header("Content-Type: application/force-download");
開發者ID:lampdhp,項目名稱:ledger-manager,代碼行數:31,代碼來源:do.php

示例15: while

			<table class="sTab" style="margin:20 auto;" >
			<tr>
			<td>
				<select name="catalog" style="line-height:30px; font-size:20px;">
					<option>請選擇</option>
					<option value="4">設備</option>
					<option value="1">備品備件</option>
					<option value="2">異動單</option>
					<option value="3">模擬單</option>
				</select>
			 </td>
			 <td><input type="text" name="name" size="50" style="line-height:30px; font-size:20px;" /></td>
			 
			 <td><input type="submit" value="搜索" class="searchBtn" style="line-height:30px; font-size:20px;"></td></tr>';
$sqlrecent = "SELECT * FROM recentsearch ORDER BY id DESC LIMIT 5";
$res = $sqlHelper->execute_dql($sqlrecent);
$row_cnt = $res->num_rows;
if ($row_cnt != 0) {
    echo "<tr><td colspan='3'>最近搜索:";
    while ($row = $res->fetch_array()) {
        echo "<a href='searchpages.php?name=" . $row['name'] . "&catalog=" . $row['catalog'] . "'>" . $row['name'] . "</a>&nbsp;";
    }
    echo "</td></tr>";
}
echo '</table>
			</div>
			</form>';
/*
	if(isset($_POST['name'])){
	
		$name=$_POST['name'];
開發者ID:lampdhp,項目名稱:ledger-manager,代碼行數:31,代碼來源:search.php


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