<?php
function __autoload($classname) {
$filename = "./". $classname .".php";
include_once($filename);
}
class empidload{
//function for load combo box
public function loadCombo(){
$connection=new connectdb();
$con=$connection->getCon();
$query = "SELECT * FROM department";
$result = mysql_query($query) or die(mysql_error());
while($row=mysql_fetch_assoc($result)){
echo "<option value='".$row["dno"]."'>".$row["detail"]."</option>";
}
}
}
?>
<html>
<body>
<select name="department" id="department" style="width:204px;" onchange="change(this);">
<?php
$emp = new empidload();// calling function for load combo boxes
$emp.loadCombo();
?>
</select>
</body>
</html>
Here I try to load combobox from MySQL database. I wrote function and call it. But it doesn't work.can anyone help me please? actually what i want to load comboboxes from database table. And also I want to change another combobox according to the value of first combobox. Please help me.