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


PHP DBUtils::query方法代碼示例

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


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

示例1: getList

 public static function getList($teacherId)
 {
     $pdo = new DBUtils();
     $sql = "select * from teacherDes where teacherId = '{$teacherId}'";
     $rs = $pdo->query($sql);
     return $rs;
 }
開發者ID:zcmyworld,項目名稱:nothing,代碼行數:7,代碼來源:mod_teacher.php

示例2: getList

 public static function getList($snavId)
 {
     $pdo = new DBUtils();
     $sql = "select * from article where snavId = {$snavId}";
     $rs = $pdo->query($sql);
     return $rs;
 }
開發者ID:zcmyworld,項目名稱:nothing,代碼行數:7,代碼來源:mod_article.php

示例3: getBuyList

 public static function getBuyList()
 {
     $pdo = new DBUtils();
     $sql = "select * from buy";
     $rs = $pdo->query($sql);
     return $rs;
 }
開發者ID:zcmyworld,項目名稱:nothing,代碼行數:7,代碼來源:mod_buy.php

示例4: getIndex

 public static function getIndex()
 {
     $pdo = new DBUtils();
     $sql = "select * from homepage";
     $rs = $pdo->query($sql);
     return $rs;
 }
開發者ID:zcmyworld,項目名稱:nothing,代碼行數:7,代碼來源:mod_index.php

示例5: getNav

function getNav()
{
    $pdo = new DBUtils();
    $sql = "select * from nav";
    $nav = $pdo->query($sql);
    $header = array();
    foreach ($nav as $key => $val) {
        $header[$val['navId']] = array("navName" => $val['navName'], "navId" => $val['navId'], "second" => array());
    }
    $sql = "select * from second_nav";
    $second = $pdo->query($sql);
    foreach ($second as $key => $val) {
        $header[$val['navId']]['second'][$val['snavId']] = array("snavName" => $val['snavName'], "snavId" => $val['snavId'], "link" => $val['snavName']);
    }
    return $header;
}
開發者ID:zcmyworld,項目名稱:nothing,代碼行數:16,代碼來源:index.php

示例6: getAdviceList

 public static function getAdviceList()
 {
     $pdo = new DBUtils();
     $sql = "select * from advice";
     $rs = $pdo->query($sql);
     return $rs;
 }
開發者ID:zcmyworld,項目名稱:nothing,代碼行數:7,代碼來源:mod_advice.php

示例7: getJoinusList

 public static function getJoinusList()
 {
     $pdo = new DBUtils();
     $sql = "select * from joinus";
     $rs = $pdo->query($sql);
     return $rs;
 }
開發者ID:zcmyworld,項目名稱:nothing,代碼行數:7,代碼來源:mod_joinus.php

示例8: getStudentReportList

 public static function getStudentReportList($type)
 {
     $pdo = new DBUtils();
     $sql = "select * from student_report where type = '{$type}'";
     $rs = $pdo->query($sql);
     return $rs;
 }
開發者ID:zcmyworld,項目名稱:nothing,代碼行數:7,代碼來源:mod_thanks.php

示例9: getOne

 public static function getOne($courseId)
 {
     $pdo = new DBUtils();
     $sql = "select * from course where courseId = {$courseId}";
     $course = $pdo->getOne($sql);
     $sql = "select * from courseType where courseId = {$courseId}";
     $courseType = $pdo->query($sql);
     return array("course" => $course, "courseType" => $courseType);
 }
開發者ID:zcmyworld,項目名稱:nothing,代碼行數:9,代碼來源:mod_course.php

示例10: json_encode

<?php

header("Content-Type:text/html;charset=utf-8");
include_once "config/dbconfig.php";
include_once "utils/dbutils.php";
$mysql = new DBUtils();
$sql = "SELECT * from articles";
$mysql->query($sql);
$qInfo = array();
if ($mysql->getResultSize() == 0) {
    $qInfo['isSuccess'] = false;
} else {
    $qInfo['isSuccess'] = true;
    $qInfo['responseText'] = $mysql->getResultSet();
}
echo json_encode($qInfo);
開發者ID:overkazaf,項目名稱:ncg,代碼行數:16,代碼來源:queryArticles.php


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