<?php
echo "<h1>Repertuar</h1>";

mysql_connect($dbconfig['address'], $dbconfig['user'], $dbconfig['password']);
mysql_select_db($dbconfig['db']);

$query = "SELECT * FROM `teatr_repertuar` ORDER BY `repID` DESC";
$result = mysql_query($query);

if (mysql_num_rows($result) == 0) {
echo "<p>Brak repertuaru w bazie.</p>";
}
else {
  while ($rep = mysql_fetch_assoc($result)) {
	$t = stripslashes(htmlspecialchars($rep['title']));
	echo "<h2>$t</h2>";
	echo "<small>autor: $rep[author]</small>";
	echo "<p>$rep[description]</p>";
	echo "<a href=\"scene.php?t=$t\">Pokaż</a>";
	echo "<hr />";
	
	}

}
?>