Problems related to PHP + mysql implementation of level-2 cascading drop-down boxes
Source: Internet
Author: User
For more information about how to implement level-2 cascade drop-down boxes in PHP + mysql, visit prawn. PHP + mysql implements level-2 cascade drop-down boxes to solve the problem of many classes, select the year of admission before selecting the class that belongs to this year. & Nbsp; the year in the first drop-down box can be read, but after a year is selected, nothing is displayed in the class drop-down box. the code is as follows, please take a look at the problem of implementing level-2 cascade drop-down boxes in PHP + mysql.
Ask the prawn door, PHP + mysql implementation level 2 cascade drop-down box, solve the class many cases, first select the admission year and then select the class of this year.
The year in the first drop-down box can be read, but after a year is selected, nothing is displayed in the class drop-down box. the code is as follows. Please check out the problem. thank you.
/*************************************** ********
**
** Database: database name (alumni), Data Table (enteryear, banji)
** Fields in table enteryear: enter_id (id number) and entertime (year)
** Fields in the banji table: id (id number), classnum (class number), and enteryear (year)
**************************************** *******/
// ******************* Select a database connection ***************
$ Link = mysql_connect ("localhost", "root ","")
Or die ("cocould not connect:". mysql_error ());
Mysql_select_db ("alumni") or die ("cocould not select database ");
// ******************* Extract province information ***************** *
$ SqlSel = "select * from enteryear order by enter_id ";
$ Result = mysql_query ($ sqlSel) or die ("Query failed:". mysql_error ());
$ Forum_data = array ();
While ($ row = mysql_fetch_array ($ result ))
{
$ Forum_data [] = $ row;
}
// Print_r ($ forum_data );
Mysql_free_result ($ result );
// ************** Obtain city information **************
$ SqlSel2 = "select * from banji order by id desc ";
If (! ($ Result2 = mysql_query ($ sqlSel2 )))
{
Die ('could not query t_city list ');
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.