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


PHP dao::genericQuery方法代码示例

本文整理汇总了PHP中dao::genericQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP dao::genericQuery方法的具体用法?PHP dao::genericQuery怎么用?PHP dao::genericQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dao的用法示例。


在下文中一共展示了dao::genericQuery方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getEvent

 public function getEvent($user_id)
 {
     $dao = new dao();
     try {
         $query = "SELECT DISTINCT e.id,e.name,e.detail,e.location,e.photo,e.time,e.date FROM event as e, user as u, event_user as eu WHERE (eu.id_user='" . $user_id . "' and e.id=eu.id_event and u.id=eu.id_user ) or e.id_autor='" . $user_id . "'  order by e.date DESC limit 7 ";
         $returnObject = $dao->genericQuery($query);
         $returnObject = $this->addMultiData($returnObject);
         return $returnObject;
         //            return $this->addPostData($returnObject);
     } catch (Exception $e) {
         throw new Exception("Failed geting the Posts, message: " . $e->getMessage());
     }
 }
开发者ID:andreseloysv,项目名称:happy,代码行数:13,代码来源:eventController.php

示例2: getPost

 public function getPost($user_id)
 {
     $dao = new dao();
     try {
         $query = "SELECT u.nick, u.id,u.photo,p.id_post,p.coment,p.media as media,pu.date FROM post as p, post_user as pu, user u WHERE \n                u.id=pu.id_user and pu.id_post=p.id_post and (pu.id_user=" . $user_id . " or \n                    pu.id_user in (select id_follower from follow where id_user=" . $user_id . ")) \n                        ORDER BY pu.date DESC limit 7 ";
         $returnObject = $dao->genericQuery($query);
         return $returnObject;
         //            return $this->addPostData($returnObject);
     } catch (Exception $e) {
         throw new Exception("Failed geting the Posts, message: " . $e->getMessage());
     }
 }
开发者ID:andreseloysv,项目名称:happy,代码行数:12,代码来源:userController.php


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