0

我被这个查询卡住了,因为它根本没有从数据库中返回任何信息,我做错了什么?大多数情况下只需要知道为什么当前函数没有返回任何东西。

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;
    }
4

0 回答 0