当前位置: 首页>>代码示例>>PHP>>正文


PHP DAO::fetch_json_part方法代码示例

本文整理汇总了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"));
开发者ID:ThisIsGJ,项目名称:unify,代码行数:9,代码来源:members.php

示例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"));
开发者ID:ThisIsGJ,项目名称:unify,代码行数:10,代码来源:get.php

示例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"));
开发者ID:ThisIsGJ,项目名称:unify,代码行数:10,代码来源:search.php

示例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"));
开发者ID:ThisIsGJ,项目名称:unify,代码行数:8,代码来源:hot.php


注:本文中的DAO::fetch_json_part方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。