本文整理汇总了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());
}
}