-1

请访问此链接: http ://tndoctors.in/doctors.php

在那六个下拉框中没有....(州,地区,位置,医学,专业,等级)

我将所有数据从 SQL DB 提取到所有下拉框。

我创建了像

STATE (state id & state name) [st.id as primary key]

DISTRICT(district id , district name and used state id as foreign key here)

location (location id , location name and used district id as foreign key here)

医药、专业、等级同上............

最后我创建了一张桌子

DOCTOR_DETAIL ( name , address , reg.no , contact details , age , and specialty , grade , medicine , district and state)

对于专业、年级、医学、地区和州,我使用上面的表格 id(主键)作为医生 _detail 表中的外键

例如,如果我选择

 STATE: TAMILNADU
 DISTRICT: COIMBATORE
 LOCATION : some data
 medicine : allopathy
 speciality : cardiac surgeon
 grade    : some data....

如果我从下拉列表中选择以上所有内容....并单击“开始”按钮...

我必须得到可能的搜索结果

4

1 回答 1

0

像这样尝试查询,仅样本

select  location , district , state from state as st left join district as dt on(dt.fkstate_id = st.id) left join location as lt on(lt.fkdistrictId = dt.id) where // Where condition
于 2013-01-09T10:38:52.317 回答