if(isset($_POST['submit'])) {
$doc = new Doc_Schedule();
$doc->doctor = $_POST['doctor'];
$doc->department = $_POST['dpt'];
$doc->sheduledate = $_POST['date'];
$doc->scheduletime = $_POST['time'];
if( $doc->create() ) {
$message = "Doctors Information Saved Successfully";
} else {
$message = join("<br/>",$doc->errors);
}
}
<select name="doctor" id="Deptmentselectbox" class="AllSelectBoxes">
<option value="">Select Doctor</option>
<?php
$sql = "SELECT `fullname`,`depid`,`docid` FROM `doctors` ORDER BY fullname ASC";
$result = $database->query($sql) or die('cannot connect to the database');
while( $row = mysql_fetch_array($result) ) {
echo"<option value= ".$row['docid'].">".$row['fullname']."</option>";
}
?>
</select>
我有一个选择框,它将在表格中显示医生。当我点击某个医生时,我想将两者都发送doctors.docid
到doctors.deptid(department id)
一个班级以进行进一步处理。
我在为部门 ID 创建新选择框的情况下找不到其他解决方案。