本文整理匯總了PHP中DAO::fetch_json_part方法的典型用法代碼示例。如果您正苦於以下問題:PHP DAO::fetch_json_part方法的具體用法?PHP DAO::fetch_json_part怎麽用?PHP DAO::fetch_json_part使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DAO
的用法示例。
在下文中一共展示了DAO::fetch_json_part方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DAO
<?php
//Get all the members of a group given a group_id
include_once "../util/mysql.php";
$dao = new DAO(false);
$group_id = $dao->escape($_POST["group_id"]);
$query = "SELECT user.user_id,user.user_picture,user.user_name FROM grouping JOIN user ON user.user_id=grouping.user_id WHERE grouping.group_id=\"{$group_id}\";";
$dao->myquery($query);
echo $dao->fetch_json_part(array("user_id", "user_picture", "user_name"));
示例2: DAO
<?php
//Print in JSON format the groups that this user belongs to, excluding their cohort group
include "../util/session.php";
include_once "../util/mysql.php";
include_once "../util/status.php";
$dao = new DAO(false);
$query = "SELECT user_group.group_id, user_group.group_name \n\t\t\t\tFROM grouping JOIN user_group ON grouping.group_id = user_group.group_id \n\t\t\t\tWHERE user_id=\"" . $user->user_id . "\" \n\t\t\t\t\tAND NOT grouping.group_id=(SELECT group_id FROM cohort WHERE cohort.cohort_id=\"" . $user->cohort_id . "\");";
$dao->myquery($query);
echo $dao->fetch_json_part(array("group_id", "group_name"));
示例3: DAO
<?php
include_once "../util/mysql.php";
$dao = new DAO(false);
$uni_id = $dao->escape($_GET["university_id"]);
$course = $dao->escape($_GET["course"]);
$course = strtolower($course);
//Take the query and return a json list of courses that might match this one
$dao->myquery("SELECT course_id,course_name FROM course WHERE LOWER(course_name) LIKE '%{$course}%' AND university_id = '{$uni_id}';");
echo $dao->fetch_json_part(array("course_id", "course_name"));
示例4: DAO
<?php
include "session.php";
include "mysql.php";
$dao = new DAO(false);
$query = "SELECT post.post_id,user.user_id,post.post_time,post.post_content,post.post_rating_up,post.post_rating_dn,user.user_name,\n\t\t\t\t(post.post_rating_up + post.post_rating_dn) AS rating,\n\t\t\t\t(SELECT COUNT(*) FROM comment WHERE comment.post_id=post.post_id) AS comments\n\t\t\t\tFROM post JOIN user ON post.user_id=user.user_id \n\t\t\t\tWHERE post.post_time > DATE(NOW()) AND post.user_id!=\"{$user->user_id}\" \n\t\t\t\tORDER BY rating DESC,comments DESC LIMIT 5;";
$dao->myquery($query);
echo $dao->fetch_json_part(array("post_id", "user_id", "post_time", "post_content", "post_rating_up", "post_rating_dn", "user_name"));