本文整理匯總了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());
}
}
示例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());
}
}