$localhost = "localhost";
$user = "pocestny";
$password = "26789094";
$databaze = "kmori2014";
mysql_connect($localhost, $user, $password) or die("Nepodařilo se připojit k databázi.Zkus to za chvíli znovu");
mysql_select_db($databaze) or die("Nepodařilo se zvolit databázi.Zkus to za chvíli znovu");
mysql_query("SET NAMES utf8");
$result = mysql_query("SELECT * FROM rssingest order by item_date ASC");
if (mysql_num_rows($result)) {
$qi=0;
while ($row = mysql_fetch_assoc($result)) {
$qi=$qi+1;
$item_id = $row['item_id'] ;
$fetch_date = $row['fetch_date'] ;
$item_title = $row['item_title'] ;
$item_description = $row['item_description'] ;
$item_date = $row['item_date'] ;
$item_url = $row['item_url'] ;
$aj = array("January","February","March","April","May","June","July","August","September","October","November","December");
$cz = array("ledna","února","března","dubna","května","června","července","srpna","září","října","listopadu","prosince");
$item_date = str_replace($aj, $cz, date('H:i:s, j. F Y', strtotime($item_date)));
echo "
".$item_date."
";
$nahoda=rand(1, 4);
echo "
".$item_description."
";
if($qi != mysql_num_rows($result)){
echo "
";
}
}
}
?>