Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5975197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:02:57+00:00 2026-05-22T21:02:57+00:00

I want to make 7 drop down list, the last 5 have the same

  • 0

I want to make 7 drop down list, the last 5 have the same content, now my problem is that the 3’rd one is displaying all the content, but the rest(4,5,6,7) are displaying only “select movie”.
Here is the code:

@$pro=$_GET['pro']; 
if(strlen($pro) > 0 and !is_numeric($pro)){ / 
    echo "Data Error";
    exit;
}   
$quer=mysql_query('SELECT DISTINCT programName,programId FROM '.TBL_PROGRAM.' order by programId'); 
if(isset($pro) and strlen($pro) > 0){
    $quer2=mysql_query("SELECT DISTINCT categorieName,id FROM ".TBL_CATEGORIE."where id=$pro order by id" );
   }else{
    $quer2=mysql_query("SELECT DISTINCT categorieName,id FROM ".TBL_CATEGORIE." order by id"); 
   } 
if(isset($pro) and strlen($pro) > 0){
    $quer3=mysql_query("SELECT DISTINCT movieName,movieId FROM ".TBL_MOVIE." where movieId=$pro order by movieId"); 
    }else{
    $quer3=mysql_query("SELECT DISTINCT movieName,movieId FROM ".TBL_MOVIE." order by movieId"); 
    } 
echo "<form method=POST name=f1 action='program.php'>";
    echo "<select name='pro[]' style='width:150' onchange=\"reload(this.form)\"><option value=''>Make your Program</option>";
    while($noticia = mysql_fetch_array($quer)) { 
        if($noticia['programId']==@$pro)
         {
           echo "<option selected value='$noticia[programId]'>$noticia[programName]</option>"."<BR>";}
        else{ 
         echo  "<option value='$noticia[programId]'>$noticia[programName]</option>";}
         }
    echo "</select>";
    echo "<BR>"; 
    echo "<select name='pro[]' style='width:150' onchange=\"reload3(this.form)\"><option value=''>Choose Categorie</option>";
    while($noticia2 = mysql_fetch_array($quer2)) { 
    if($noticia2['id']==@$pro)
    {
        echo "<option selected value='$noticia2[id]'>$noticia2[categorieName]</option>"."<BR>";}
    else{ 
        echo  "<option value='$noticia2[id]'>$noticia2[categorieName]</option>";}
    }
    echo "</select>";
    echo "<BR>"; 
    $i=0;
    while($i<5){
        echo "<select name='pro[]' style='width:150' ><option value=''>Select movie</option>";

        while($noticia3 = mysql_fetch_array($quer3) ) {

        echo  "<option value='$noticia3[movieId]'>$noticia3[movieName]</option> ";

    }
    echo "</select>";
    echo "<BR>";
    $i++;
    }
echo"<input type=hidden name=submit value=1>";
echo "<input type=submit value=Submit>";
echo "</form>";
?>

Any advice, any other method is welcome.Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:02:58+00:00Added an answer on May 22, 2026 at 9:02 pm

    once you fetch record from mysql result its move its position to next row… by the end of 1st loop the position will remain in end of record state so from the second time loop it will just print blank.

    So better:
    1.) Store the options list in string
    2.) print the list in loop

    instead use:

    $i=0;
    $strOptions = '';
    while($noticia3 = mysql_fetch_array($quer3) ) {
    
         $strOptions .=  "<option value='$noticia3[movieId]'>$noticia3[movieName]</option>";
    
    }
    while($i<5){
        echo "<select name='pro[]' style='width:150' ><option value=''>Select movie</option>";
        echo $strOptions;
        echo "</select>";
        echo "<BR>";
        $i++;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my CakePHP site, I want to make a drop-down list of all Venues
I have an auto-complete drop down list, I want to make some action when
I have custom control with two textboxes and one drop down list. I want
I want to make a drop-down list from scratch. Can anyone please tell me
I'm using html SELECT to make 3 drop-down menus. One for a list of
Possible Duplicate: make drop down list item unselectable I have an asp.net dropdownlist and
I want to make drop-down list for categories. How to make text inside select
i have 4 menu drop down list that i bind a click that calls
I have several user controls that contain a drop down list, various validation controls,
So the problem I am currently having is that I have A drop down

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.