Home > Backend Development > PHP Tutorial > 究了一下连动下拉菜单,共享一下,希望有人能继续完善。_PHP

究了一下连动下拉菜单,共享一下,希望有人能继续完善。_PHP

WBOY
Release: 2016-06-01 12:39:34
Original
838 people have browsed it

PHP代码:--------------------------------------------------------------------------------



List


if( !( $link = mysql_connect() ) ){
fatal("Could not connect to local MySQL server.");
}

if( !mysql_select_db( "loaction", $link ) )
{
mysql_close( $link );
fatal("Could not select database ParserSample.");
}

$sql="select * from district order by locationid asc";
$query=mysql_query($sql,$link);
?>




分类:







if(!empty($_POST['City'])){
echo $_POST['City'];
}
?>


表结构:

#
# 表的结构 `district`
#
# 创建时间: 2003 年 08 月 02 日 11:21
# 最后更新时间: 2003 年 08 月 02 日 11:21
#

CREATE TABLE `district` (
`locationid` int(10) NOT NULL default '0',
`districtid` int(10) NOT NULL auto_increment,
`areacode` varchar(4) NOT NULL default ',
`zipcode` varchar(6) NOT NULL default ',
`districtname` varchar(50) NOT NULL default ',
KEY `districtid` (`districtid`)
) TYPE=MyISAM AUTO_INCREMENT=7 ;

#
# 表`district`中数据locationid——省id;districtid——市id;districtname——市名称; areacode ——市区号;zipcode——市邮政编码
#

# --------------------------------------------------------

#
# 表的结构 `loaction`
#
# 创建时间: 2003 年 08 月 02 日 09:28
# 最后更新时间: 2003 年 08 月 02 日 10:36
#

CREATE TABLE `loaction` (
`loactionid` int(10) NOT NULL auto_increment,
`loactionname` varchar(50) NOT NULL default ',
KEY `loactionid` (`loactionid`)
) TYPE=MyISAM AUTO_INCREMENT=4 ;

#
# 表`loaction`中数据,loactionid——省id;loactionname——省名称
#

#表
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template