if ($rs = $this->db->query($query)) {
                    $return = array(); 
                    
                    while ($row = $rs->fetch_assoc()) {
                        if (!in_array($row['privmsgs_id'], $return)) {