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>
發送兩個ID我有一個選擇框,它會告訴我在一個表中的醫生。當我點擊某個醫生時,我想將doctors.docid
和doctors.deptid(department id)
發送給一個班級進行進一步處理。通過選擇框
我很難找到一個解決方案,其他丹創建一個新的部門ID選擇框。
迄今提出的所有解決方案應該爲你工作 – 2013-03-09 20:59:49
請考慮接受一個答案(點擊左側刻度),如果它實際上回答了你的問題 – michi 2013-04-14 12:50:12