1
HI
How to fill XoopsFormSelect with data directly from the db.
I need to get the Category Name in Drop Down Select Option ..
This wht i tried .. but it Only Brings One Category Name ..
$sql = "SELECT cat_id,cat_name FROM ".$xoopsDB->prefix("test_category");
$result = $xoopsDB->query($sql);
while (list($cat_id, $cat_name) = $xoopsDB->fetchRow($result) ) {
$select_element = new XoopsFormSelect('', 'cat');
$select_element->addOption($cat_id, $cat_name);
}
$form->addElement($select_element);