Sure ! OK, I needed to be able to record the 'main_cat_title' within the 'sub-cat- record for sorting later on. I didn't need the hidden input field at all cause it won't work that way w/o lots of javascript manipulation. So I simply did another query at POST time to extract the 'main_cat_title' from the db based on the posted 'main_cat_id' from the select structure thusly:
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
$result1 = dbquery("SELECT mus_cat_title FROM ".DB_MM_MUSIC_CATS." WHERE mus_cat_id='".$_POST['mus_cat_id']."' AND mus_parentid='0'"
;
$data = dbarray($result1);
$mus_parent_title = $data['mus_cat_title'];
$result = dbquery("INSERT INTO ".DB_MM_MUSIC_CATS." (mus_cat_id, mus_cat_title, mus_cat_desc, mus_cat_user, mus_cat_img, mus_cat_access, mus_parentid, mus_parent_title, mus_cat_datestamp, mus_cat_status) VALUES ('', '$mus_cat_title', '$mus_cat_desc', '".$userdata['user_id']."', '$mus_cat_img', '$mus_cat_access', '$mus_cat_id', '$mus_parent_title', '".time()."', '$mus_cat_status'
"
;
[/syntaxhighlighter]
Works great!! Then my ORDER BY sort function became:
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
$result = dbquery("SELECT mus_cat_id, mus_cat_title, mus_cat_desc, mus_cat_img, mus_parentid, mus_parent_title, mus_cat_status FROM ".DB_MM_MUSIC_CATS."
WHERE mus_cat_status='1' AND mus_parentid>'0' ORDER BY mus_parent_title, mus_cat_title ASC LIMIT $subcatz"
;
[/syntaxhighlighter]
If you'd like to see the whole thing in action just visit my mod-support site(need to register)
www.whisperwillow.com/