dbConnection, 'SELECT c.*, cs.`status_text`, (SELECT ph.`payment_date` FROM `paying_history` ph WHERE ph.`clubmember_id` = c.`id` ORDER BY `payment_date` DESC LIMIT 1) as last_payment ' . 'FROM `clubmember` c ' . 'JOIN `clubmember_status` cs ' . ' ON cs.`id` = c.`membership_status` ' . 'WHERE cs.`status_text` NOT IN ("Mitgliedschaft abgelehnt", "Mitgliedschaft gekündigt") ' . 'ORDER BY c.`last_name`, c.`first_name`'); $tableBody = ''; while ($row = mysqli_fetch_assoc($result)) { $tableBody .= '' . '' . $row['id'] . '' . '' . $this->decode($row['last_name'], $row['salt']) . ', ' . $this->decode($row['first_name'], $row['salt']) . '' . '' . $this->decode($row['email'], $row['salt']) . '' . '' . $row['last_payment'] . '' . '' . $row['membership_start'] . '' . '' . $row['status_text'] . '' . 'Bearbeiten ' . 'Zahlungen' . ''; } $tableBody .= ''; $this->content['memberlist'] = $tableBody; } }