i ma wyświetlić odpowiednie dla niego dane spełniając warunki wiem że trochę pokręciłem bazę itd. ale wyskakuje mi bląd
Cytat
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /opt/lampp/htdocs/wiersze/1/view.php on line 39
myślę że mam złe zapytanie zrobione...
a więc to kod view.php :
<?php $tytul = "Życzenia"; include('naglowek.php'); include('gora.php'); include('db.php'); ?> <div id="templatemo_background_section_mid"> <div class="templatemo_container"> <div id="templatemo_content_area"> <div id="templatemo_left_section"> <div class="templatemo_left_section_box"> <?php $subpage = $_GET['page']; $perPage = 15; { $subpage = (int) $_GET['subpage']; } if ($subpage < 1) { $subpage = 1; } $id_kate = $_GET["id_kategori"]; $kate = $_GET["nazwa"]; $start = ($subpage - 1) * $perPage; $zapytanie = 'SELECT * FROM wszystko ORDER BY id DESC LIMIT '.$start.', '.$perPage.' WHERE id_kategori='.$id_kate.' AND nazwa_tabeli='.$kate.''; $max = "SELECT COUNT(*) as max FROM wszystko"; { { $id = $wiersz["id"]; $id_kategorii = $wiersz["id_kategori"]; $nazwa_tabeli = $wiersz["nazwa_tabeli"]; $tytul = $wiersz["tytul"]; $uzytkownik = $wiersz["uzytkownik"]; $data = $wiersz["data"]; $tresc = $wiersz["tresc"]; echo '<a href="pokaz.php?id='.$id.'&id_kategorii='.$id_kategorii.'&nazwa_tabeli='.$nazwa_tabeli.'"><div class="templatemo_left_section_box_top">'.$tytul.'</div></a>'; } } $prev = $subpage - 1; $next = $subpage + 1; $prevLink = 'index.php?page='.$prev; $nextLink = 'index.php?page='.$next; $ilosc_wierszy = $maxrecords['max']; if($subpage > 1) for($i=1; $i<=$stron; ++$i) { if($i==$subpage) else } if($subpage < $stron) ?> </center> </div> </div> </div><!-- End Of left Section --> <?php include('kategorie.php'); include('prawa-strona.php'); include('stopka.php'); ?>
kategorie.php :
<div id="templatemo_middle_section"> <div class="templatemo_middle_section_box"> <h1>Kategorie</h1> <ul> <?php $query = "SELECT * FROM zyczenia"; $id = $row["id"]; $kategoria = $row["kategoria"]; } ?> </ul> </div> </div><!-- End Of Middle Section -->
a to baza danych:
CREATE TABLE wszystko ( `id` INT(11) NOT NULL AUTO_INCREMENT, `id_kategori` INT(11) NOT NULL, `nazwa_tabeli` VARCHAR(30) NOT NULL, `tytul` VARCHAR(50) NOT NULL, `tresc` TEXT NOT NULL, `uzytkownik` VARCHAR(30) NOT NULL, `data` timestamp NOT NULL, PRIMARY KEY (`id`) );
