$spojenie = mysql_connect("localhost","root","" );
if (!$spojenie):
echo "Spojenie s DB sa nepodarilo !";
else:
MySQL_Select_DB("rudko");
switch ($_GET["zorad"]) {
case 1:
$sql=MySQL_Query("Select * from filmy order by nazov asc");
break;
case 2:
$sql=MySQL_Query("Select * from filmy order by nazov desc");
break;
case 3:
$sql=MySQL_Query("Select * from filmy order by rok_vydania asc");
break;
case 4:
$sql=MySQL_Query("Select * from filmy order by rok_vydania desc");
break;
case 5:
$sql=MySQL_Query("Select * from filmy order by cena asc");
break;
case 6:
$sql=MySQL_Query("Select * from filmy order by cena desc");
break;
case 7:
$sql=MySQL_Query("Select * from filmy order by vydavatelstvo asc");
break;
case 8:
$sql=MySQL_Query("Select * from filmy order by vydavatelstvo desc");
break;
default:
$sql=MySQL_Query("Select * from filmy");
}
if (!$sql):
echo "Doslo k chybe pri vytvarani SQL dotazu !";
else:
?>