| Index
» Projekty
» phpMyEdit
» Fórum
» Cats w/ subcats |
 |
Zack
Založený: 23.07.2004
Príspevky: 5
Zaslal: 2004-07-23 23:02
Návrat hore
Odpovedať s citátom
|
Hello,
Found your site and love phpMyEdit. It is a big help. I did a load of searching across the net and in your forums for some answers on populating a <select> dropdown with cats and sub-cats and have struck out.
Current Setup:
Table: categories
cid
name
pcatcid
Table: ak
id
cid
business_name
---------------------------------
$opts['fdd']['cid'] = array(
'name' => 'Occupation',
'select' => 'D',
'colattrs' => 'align="center" ',
'options' => 'LV',
'maxlen' => 11,
'default' => '0',
'required' => true,
'sort' => true
);
$opts['fdd']['cid']['values']['table']='categories';
$opts['fdd']['cid']['values']['column']='cid';
$opts['fdd']['cid']['values']['description'] = 'name';
This works ok to make a filter dropdown
cid1
cid2
cid3
How would I make it populate the dropdown like this:
cid1
- pcatcid1
- pcatcid1
cid2
- pcatcid2
- pcatcid2
cid3
- pcatcid3
- pcatcid3
and the pcatcid sort ASC ?
"cid" is a parent Cat, and if it has a value in "pcatcid" it becomes a sub cat, and does not show up as a cat anymore.
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2004-07-26 11:20
Návrat hore
Odpovedať s citátom
|
imho that's not possible.
you can make it like
cid1 - catcid1
cid1 - catcid2
cid2 - catcid1
...
using 'description' as an array.
|
Zack
Založený: 23.07.2004
Príspevky: 5
Zaslal: 2004-07-26 15:12
Návrat hore
Odpovedať s citátom
|
cool, that will work.
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|