當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。