How can I loop inside an array in my code?
This is the static version of my script:
$val=array(
array("value" => "Male","label" => "Male"),
array("value" => "Female","label" => "Femal"),
);
my_form("Gender","select","gender",$val,"",5);
Then, I need to retrieve the value and label from the database.
So I customized my previous code to:
$div=array(
while($h = mysql_fetch_array($qwery)){
array("value" => "$h[id]","label" => "$h[div]"),
}
);
my_form("Division","select","id_div",$div,"",5);
When I run it I get this Error message:
Parse error: syntax error, unexpected 'while' (T_WHILE), expecting ')'
Can anyone help me?
I want to loop the join data from my database into :
input type="Select"
java?