0 and !is_numeric($cat)){ // to check if $cat is numeric data or not. echo "Data Error"; exit; } ///////// Getting the data from Mysql table for first list box////////// $quer2="SELECT DISTINCT name_articletype,idarticletype FROM article_type"; ///////////// End of query for first list box//////////// /////// for second drop down list we will check if category is selected else we will display all the subcategory///// if(isset($cat) and strlen($cat) > 0){ $quer="SELECT DISTINCT idmodelarticle,modelarticle FROM modelarticle where idarticletype=$cat"; }else{$quer="SELECT DISTINCT idmodelarticle,modelarticle FROM modelarticle"; } ////////// end of query for second subcategory drop down list box /////////////////////////// echo "
"; /// Add your form processing page address to action in above line. Example action=dd-check.php//// ////////// Starting of first drop downlist ///////// echo ""; ////////////////// This will end the first drop down list /////////// ////////// Starting of second drop downlist ///////// echo ""; ////////////////// This will end the second drop down list /////////// //// Add your other form fields as needed here///// echo ""; echo "
"; ?>

Reset and start again

PHP SQL HTML free tutorials and scripts