我坚持这个查询,因为它没有从数据库中返回任何信息,我做错了什么? 通常只需要知道为什么当前函数没有返回任何内容。
public $perpage = 10; // Uploads perpage
PUBLIC FUNCTION Updates( $uiD, $lastid ){
$data = "";
$morequery = "";
if( $lastid )
$morequery = "AND M.post_iD < '".$lastid."' "; // More Button End
$sth = $this->db->prepare("
SELECT M.post_iD, M.uid_fk, M.message, M.created, U.username, M.uploads
FROM Posts M, users U
WHERE U.status = '1' AND M.uid_fk = U.uiD AND M.uid_fk = '$uiD' $morequery
ORDER BY M.post_iD DESC limit" .$this->perpage);
while( $row = $sth->fetchAll(PDO::FETCH_ASSOC) ){
$data = $row;
}
return $data;
}