PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
function loadDept(){
include('Conn.php');
$sql="Select deptName from tblDepartments order by deptName";
$query=mysql_query($sql) or die ("Deparments can not be loaded.");
while($row=mysql_fetch_assoc($query)){
$arrDeparments[]=$row;
}
foreach ($arrDeparments as $d) echo "<OPTION>{$d['deptName']}</OPTION>\n";
}
?>
when i do this the list box show the first value always in the text area of the list box even without selecting a value how to get rid from this since, sometimes i do not want to save the value from this list box.