You are here: categories and sub categories « PHP « IT news, forums, messages
categories and sub categories

Posted by Merlin on 06/06/05 10:29

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация