Juz nie trzeba pomocy poradzilem sobie mozna skasowac ... itd
A wiec mam problem z wyświetlaniem wszsytkich newsów.
(oczywiscie w bazie mam 2 newsy i chce aby sie wyswietily)
news.php
<?php include 'config.php'; include 'template/template.inc.php'; $tmpl = new Template('template/news.tpl'); $zapytanie = 'SELECT * FROM news where id='.NR.''; 'tytul' => $wiersz['tytul'], 'news' => $wiersz['text'], 'data' => $wiersz['data'], 'dodal' => $wiersz['dodal'] ); } $tmpl->add($news); ?>
news.tpl
template.inc.php
<?php class Template { var $tmpl; var $dane; var $jezyk; function Template ($name) { } function add($name, $value = '') { $this->dane[$name] = $value; } } function execute() { $this->tmpl); } } ?>
CREATE TABLE `news` ( `id` text NOT NULL, `tytul` text NOT NULL, `text` text NOT NULL, `data` date NOT NULL DEFAULT '0000-00-00', `dodal` text NOT NULL, `jezyk` text NOT NULL ) TYPE=MyISAM; -- -- Zrzut danych tabeli `news` -- INSERT INTO `news` VALUES ('1', 'News 1', 'to jest news news 1', '0000-00-00', 'Jacek', 'pl'); INSERT INTO `news` VALUES ('1', 'News 2', 'to jest tekst news 2', '0000-00-00', 'Darek', 'pl');