Problem polega na tym iz nie wiem jak zrobić Menu drzewko. Nie mam problemu z wyświetleniem wynikow z bazy tylko z sortowaniem tak aby wygladało to tak:
Grupa 1
- Produkt 1
- Produkt 2
- Produkt 3
Grupa 2
- Produkt 1
- Produkt 2
- Produkt 3
itd...
Ilość pozycji i grup zależna jest od tego ile sie tego wprowadzi przez panel admina.
Także chodzi mi głownie jak to wyświetlić w takiej strukturze jak wyżej podałem.
Oto co posiadam:
Index.php
<?php include('baza.php'); { } ?>
cat.php
<?php include('baza.php'); $id = (int)$_GET['id']; { echo '<a href="art.php?id='.$row['id'].'"><b>'.stripslashes($row['tytul']).'</b></a> <!--('.date("d.m.Y, H:i", $row['data']).') --> <br />'; } ?>
art.php
<?php include('baza.php'); $id = (int)$_GET['id']; { else { $query = "INSERT INTO `articles_comments` (`id_art`, `nick`, `tresc`, `data`) VALUES ('$id', '$nick', '$tresc', '$data')"; } } ?>
I struktura bazy:
CREATE TABLE `articles` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_cat` int(11) NOT NULL, `tytul` text NOT NULL, `tresc` text NOT NULL, `opis` text NOT NULL, `data` int(11) NOT NULL, `suma` int(11) NOT NULL, `ocen` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM ; CREATE TABLE `articles_categories` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tytul` text NOT NULL, `opis` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM ; CREATE TABLE `articles_comments` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_art` int(11) NOT NULL, `nick` text NOT NULL, `tresc` text NOT NULL, `data` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM ;