<?php

function db_gericht_select_intern()
{
    try {
        $link = connectdb();

        $sql = 'SELECT name, preisintern FROM gericht WHERE preisintern > 2 ORDER BY name DESC';
        $result = mysqli_query($link, $sql);

        $data = mysqli_fetch_all($result, MYSQLI_BOTH);

        mysqli_close($link);
    } catch (Exception $ex) {
        $data = array(
            'id' => '-1',
            'error' => true,
            'name' => 'Datenbankfehler ' . $ex->getCode(),
            'beschreibung' => $ex->getMessage());
    } finally {
        return $data;
    }
}