prepare("select name from sections s where article = ? order by ord asc")) { $stmt->bind_param("s", $article); $stmt->execute(); $stmt->bind_result($name); while ($stmt->fetch()) { $sections[] = $name; } } $name = isset($_POST["section"]) && $_POST["section"]!="" ? $_POST["section"] : ($sections[0] ?? "Empty"); $content = "Hallo"; if ($stmt = $mysqli->prepare("select content from sections s where name = ? and article = ?")) { $stmt->bind_param("ss", $name, $article); $stmt->execute(); $stmt->bind_result($content); $stmt->fetch(); } $id = preg_replace('/\s+/', '', $article."_".$name); ?>