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の新しい選択ボックスを作成する以外の解決策を見つけるのに苦労しています。