I have a php page with a dropdown list that is populated by a mysql query.
$departmentsql="select `department` from `departments` order by department";
$resultdepartment=mysql_query($departmentsql);
$optionsdepartment="";
while ($row=mysql_fetch_array($resultdepartment)) {
$department=$row["department"];
$optionsdepartment.="<OPTION VALUE=\"$department\">".$department;
}
drop down list code
<SELECT NAME="department" id="department">
<OPTION VALUE=0 >
<?=$optionsdepartment?>
</SELECT>
I have an option on the page to add a new department, which happens in a drop down list. Once I have added the department? This can be initiated byt he popup page closing or by a refresh link on the page?
Can this be done with PHP or is Javascript required?
Thanks and Regards,
Ryan
You need to use AJAX based queries to achieve this.