帮助下拉菜单mysql php [英] Help with drop down menu mysql php

查看:50
本文介绍了帮助下拉菜单mysql php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我正在建立一个数据库,我有5个表:
使用者:
用户ID(PK)
密码
名称
PROYECT:
projectid(PK)
用户ID(FK)
国家:
countryid(PK)
projectid(FK)
州:
状态ID(PK)
countryid(FK)
城市:
cityid(PK)
stateid(FK)
我有一个php网站,我有4个下拉菜单,第一个必须显示我proyects,具体取决于我选择的项目,
第二个下拉菜单必须向我显示已分配给该项目的国家/地区,具体取决于我选择的国家/地区,
第三个下拉菜单必须向我显示分配给该国家的州,具体取决于我选择的州
第三个下拉菜单必须显示分配给该州的城市.
如果您知道我该怎么做,或者您有手册,请提供给我,谢谢!!!!!!

Hello,
i am making a database, i have 5 tables:
USER:
userid (PK)
password
name
PROYECT:
projectid (PK)
userid (FK)
COUNTRY:
countryid (PK)
projectid (FK)
STATE:
stateid (PK)
countryid (FK)
CITY:
cityid (PK)
stateid (FK)
i have a php web, i have 4 drop down menu, the first one has to show me the proyects, dependeding on the project i have choosen,
the second drop down menu has to show me the countries that have been assigned to that project, depending on the country i have choosen,
the third drop down menu has to show me the states assigned to that country, depending on the state i have choosen
the third drop down menu has to show me the cities assigned to that state.
if you know how i can do this or you have a manual please provide it to me, THANKS!!!!!!

require('conn.php');
sql="SELECT proyectid FROM proyect";
$result=mysql_query($sql);
$options="";
while ($row=mysql_fetch_array($result)) {
$id=$row["id"];
$menu=$row["menu"];
$options.="<OPTION VALUE=\"$id\">".$menu;
}
?>
<SELECT NAME=menu>
<OPTION VALUE=0>Choose
<?php $options ?>
</SELECT>

推荐答案

result = mysql_query(
result=mysql_query(


sql);


options = "; 而(
options=""; while (


这篇关于帮助下拉菜单mysql php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆