You are on page 1of 1

$categoryoption=array();

$selcat=db_query("SELECT * from
term_hierarchy,term_data WHERE term_data.tid=term_hierarchy.tid and
term_hierarchy.parent =1");
while($fetcat=db_fetch_array($selcat))
{
$Tid = $fetcat['tid'];
$tidname =$fetcat['name'];

$categoryoption[$tidname]=$tidname;

$form['selectbox'] = array(
'#type' => 'select',
'#title' =>
t('Coutry'),
//'#default_value' =>
$node->selectbox,
'#options'
=>$categoryoption,
'#description' =>
t('Please choose an option.'),
'#weight' =>
-1,
);