function ctidata($dotaz) // fce pro pristup do databáze { do{ $spojeni = MySQL_Connect("localhost","uzprawy","o270608KRD"); if(!$spojeni): $i = "es"; break; endif; MySQL_Select_DB("dbzprawy1"); @$vysledek = MySQL_Query($dotaz); if(!$vysledek): $i = "ev"; break; endif; $i = $vysledek; MySQL_Close($spojeni); } while(false); return $i; } if($kategorie=="")$kategorie=1; if($sort=="")$sort=1; if($sort==1) $aa = ctidata("select * from Seznam where Kategorie=$kategorie and (Autor like '%".$filtr."%' or Nazev like '%".$filtr."%' or Klicova_Slova like '%".$filtr."%') order by Nazev desc"); if($sort==2) $aa = ctidata("select * from Seznam where Kategorie=$kategorie and (Autor like '%".$filtr."%' or Nazev like '%".$filtr."%' or Klicova_Slova like '%".$filtr."%') order by Nazev"); if($sort==3) $aa = ctidata("select * from Seznam where Kategorie=$kategorie and (Autor like '%".$filtr."%' or Nazev like '%".$filtr."%' or Klicova_Slova like '%".$filtr."%') order by Autor desc"); if($sort==4) $aa = ctidata("select * from Seznam where Kategorie=$kategorie and (Autor like '%".$filtr."%' or Nazev like '%".$filtr."%' or Klicova_Slova like '%".$filtr."%') order by Autor"); if($sort==5) $aa = ctidata("select * from Seznam where Kategorie=$kategorie and (Autor like '%".$filtr."%' or Nazev like '%".$filtr."%' or Klicova_Slova like '%".$filtr."%') order by Klicova_Slova desc"); if($sort==6) $aa = ctidata("select * from Seznam where Kategorie=$kategorie and (Autor like '%".$filtr."%' or Nazev like '%".$filtr."%' or Klicova_Slova like '%".$filtr."%') order by Klicova_Slova"); ?>