categories and sub categories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there,

I am trying to retrieve cat and subcategories out of 2 db tables and output them via php. That seems not to be that trivial.

My goal is to have output like this:

- Languages
	: php
	: asp
- Fruites
	: apples
	: peaches

Therefore I do have a table cat and a tabel sub_cat and the values are filled into the arrays $cat[main][name] and $cat[sub][name].

Now here is my output try:

for ($i=0;$i<count($cat[main][name]);$i++){
	# output main cat
	echo $cat[main][name][$i];
		
	# output subcats which belong to this main cat
	for ($k=0;$k<count($cat[sub][name]);$k++){
		cat[sub][name][$k];
	}
};

I am lost here and could need some advice. Any help is appreciated.

Merlin

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux