How to delete duplicate data after a loop cascade drop-down box in a php webpage

Source: Internet
Author: User
How to delete duplicate data in the loop cascade drop-down box on the php webpage. for example, a material has a variety of styles, different thicknesses of the cloth, and different thicknesses of the resin cloth.
Cascade drop-down lists using Javascript in PHP web pages. Use a material as a drop-down box (primary choice). when selecting one of the materials, how to assign the corresponding operator to a drop-down box (derivative Box 1 ), the corresponding resin is assigned to another drop-down box (derivative box 2 ),. my code is as follows. Why does the derivative box contain duplicate data? How can I delete this duplicate data?










Header ("Content-Type: text/html; charset = gb2312 ");
$ Link = mysql_connect ("localhost", "root", "12345670 ")
Or die ("cocould not connect:". mysql_error ());
Mysql_select_db ("test") or die ("cocould not select database ");
Mysql_query ("set names 'gb2312 '");
$ SqlSel = "select * from material ";
$ 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 );


$ SqlSel2 = "select * from core left join prepreg on core. Material = prepreg. Material ";

If (! ($ Result2 = mysql_query ($ sqlSel2 )))
{
Die ('could not query core list ');
}

$ Forum_data2 = array ();
While ($ row2 = mysql_fetch_array ($ result2 ))
{
$ Forum_data2 [] = $ row2;
}

Mysql_free_result ($ result2 );

?>


Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.