请改为关注此帖子 检查我的以下帖子 请 链接多项选择
我有这个代码,用户在其中选择特定的医生类别,然后选择他想要查看的地区。状态后他需要点击车站(在选定的地区)医生>>地区>>车站
Here is the code
<html>
<body>
<form action="process.php" method="post">
<select name="cat">
<?php
$sql="select distinct Category from doctors order by Category asc";
$query=mysql_query($sql);
while($row=mysql_fetch_array($query))
{
echo "<option value='{$row[Category]}'>{$row[Category]}</option>";
}
?>
</select>
<select name="station">
<?php
$sql_1="select distinct Station from doctors order by Station asc";
$query_1=mysql_query($sql_1);
while($row=mysql_fetch_array($query_1))
{
echo "<option value=".$row[Station].">".$row[Station]."</option>";
}
?>
</select>
<input name="C" type="submit" />
</form>
</body>
</html>
进程.php
$mySqlStm ="SELECT Name FROM doctors WHERE Category='$myValue' and Station='$myStation'";
$result2 = mysql_query($mySqlStm) or die("Error:mysql_error()");
if(mysql_num_rows($result2) == 0){
echo("<br/>no records found");
}
ELSE
{
echo "<table border='1'>";
//ECHO THE RECORDS FETCHED
while($row = mysql_fetch_array($result2))
{
echo "<tr>";
//echo "<td>" . $row['Station'] . "</td>";
echo "<td>" . $row['Name'] . "</td>" ;
//echo "<td>" . $row['Phone 1'] . "</td>";
//echo "<td>" . $row['Mobile'] . "</td>";
}
I want the station category to be auto filled when district is selected and When a category of doctor is selected, the district has to be auto filled.
我该怎么做?我更喜欢 Javascript,因为我对此有所了解。另外,我将所有数据都放在一个数据库中,看起来像这样
类别 | 车站 | 区 | 姓名 | 资质等