diff --git a/include/stundenplan.class.php b/include/stundenplan.class.php index 266571b9e..4e2ce85fc 100644 --- a/include/stundenplan.class.php +++ b/include/stundenplan.class.php @@ -262,9 +262,9 @@ class stundenplan extends basis_db public function getStunden($lehreinheit_id) { - $qry = 'SELECT count(*) AS stunden ' + $qry = 'SELECT count(*) as stunden FROM (SELECT lehreinheit_id, datum, stunde ' . 'FROM lehre.tbl_stundenplan ' - . 'WHERE lehreinheit_id = ' . $this->db_add_param($lehreinheit_id); + . 'WHERE lehreinheit_id = ' . $this->db_add_param($lehreinheit_id).' GROUP by lehreinheit_id, datum, stunde) as a'; $result = $this->db_query($qry);