本文整理汇总了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);