我正在开发一个预订系统。我的网站目前的工作方式是用户登录并选择约会。我需要帮助来显示他们在下一页上预订的约会。此外,当他们预订约会时,其他用户应该不再可以使用它。
<?php
{
mysql_connect("localhost" , "" , "") or die (mysql_error());
mysql_select_db("") or die(mysql_error());
$pid=intval($_SESSION["Patient_id"]); $query = "SELECT t1.*, t2.Doctor_name, t2.Doctor_room FROM Appointment AS t1 INNER JOIN Doctor AS t2 ON t1.Doctor_id=t2.Doctor_id";
//executes query on the database
$result = mysql_query ($query) or die ("didn't query");
//this selects the results as rows
$num = mysql_num_rows ($result);
while($row=mysql_fetch_assoc($result))
{
$_SESSION['Appointment_date'] = $row['Appointment_date'];
$_SESSION['Appointment_time'] = $row['Appointment_time'];
$_SESSION['Doctor_name'] = $row['Doctor_name'];
$_SESSION['Doctor_room'] = $row['Doctor_room'];
}
}
?>
<strong>Dates available</strong>
<select id="Availability" name="Availability">
<option value="0">--Select date--</option>
<option value="3"><?php echo $_SESSION['Appointment_date'];?></option>
</select>
<br />
<br />
<strong>Times available</strong>
<select id="Availability" name="Availability">
<option value="0">--Select time--</option>
<option value="3"><?php echo $_SESSION['Appointment_time'];?></option>>
</select>
<br />
<br />
<strong>Doctor Name</strong>
<select id="Availability" name="Availability">
<option value="0">--Name--</option>
<option value="2"><?php echo $_SESSION['Doctor_name'];?></option>>
</select>
<br />
<br />
<strong>Doctor Room</strong>
<select id="Availability" name="Availability">
<option value="0">--Room--</option>
<option value="2"><?php echo $_SESSION['Doctor_room'];?></option>>
</select>
上面的代码允许用户根据可用的内容进行约会。此表称为约会表。当用户单击下一步时,我需要将此信息显示给用户,以便显示他们的约会,并且约会不应再对其他用户可用
谢谢!