本文整理匯總了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;
}
示例2: getList
public static function getList($snavId)
{
$pdo = new DBUtils();
$sql = "select * from article where snavId = {$snavId}";
$rs = $pdo->query($sql);
return $rs;
}
示例3: getBuyList
public static function getBuyList()
{
$pdo = new DBUtils();
$sql = "select * from buy";
$rs = $pdo->query($sql);
return $rs;
}
示例4: getIndex
public static function getIndex()
{
$pdo = new DBUtils();
$sql = "select * from homepage";
$rs = $pdo->query($sql);
return $rs;
}
示例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;
}
示例6: getAdviceList
public static function getAdviceList()
{
$pdo = new DBUtils();
$sql = "select * from advice";
$rs = $pdo->query($sql);
return $rs;
}
示例7: getJoinusList
public static function getJoinusList()
{
$pdo = new DBUtils();
$sql = "select * from joinus";
$rs = $pdo->query($sql);
return $rs;
}
示例8: getStudentReportList
public static function getStudentReportList($type)
{
$pdo = new DBUtils();
$sql = "select * from student_report where type = '{$type}'";
$rs = $pdo->query($sql);
return $rs;
}
示例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);
}
示例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);