html - php mysql select with different values -


i have table exercises , want generate want visitor can select number of exercises him wants... every exercise must appear in different select , need first value in every select different. have code:

<form class="form-horizontal" action="wod_auto_sartu.php" method="post" enctype="multipart/form-data"> <?php $numbers = range(1, 12); shuffle($numbers); ($i=1;$i<=$num_jornadas;$i++){     $numbers2=$numbers[$i];     $random_wod=$wod[$numbers2]; ?>     <div class="form-group">         <label for="inpuname" class="col-md-4 control-label"><font color="#fff"><b><?php echo _("jornada: $i"); ?></b></font></label>         <div class="col-md-6">             <select class="form-control  c-square c-theme" id="wod" style="opacity: .8;max-width:80%;" name="num_jornadas" method="post"> <?php     foreach ($numbers $row){         echo '<option value='. $random_wod[0] .'>'. $random_wod[1] .'</option>';     } ?>     </select>         </div>    </div> <?php } ?> 

in moment, info have mentioned, if unfold select same value in options, need said first option in every option different when unfold, need see other exercises, not same...

how can solve it?

example image

problem solved!! had error of concept... introducing same array time waiting different output ... einstein said... "stupidity repeating same error expecting different results"

the correct code:

<form class="form-horizontal" action="wod_auto_sartu.php" method="post" enctype="multipart/form-data"> <?php $lista_wods = array(); foreach($wod $row=>$value): $lista_wods[] = '<option value="'.$row.'">' .$value[1].'</option>'; endforeach;  $numbers = range(1, 12); shuffle($numbers); ($i=1;$i<=$num_jornadas;$i++){     $numbers2=$numbers[$i];     $random_wod=$wod[$numbers2]; ?> <div class="form-group">     <label for="inpuname" class="col-md-4 control-label"><font color="#fff"><b><?php echo _("jornada: $i"); ?></b></font></label>     <div class="col-md-6">         <select class="form-control  c-square c-theme" id="wod" style="opacity: .8;max-width:80%;" name="num_jornadas" method="post"> <?php        print_r ('<option value='. $random_wod[0] .'>'. $random_wod[1] . '</option>');        print_r(array_values($lista_wods)); ?>         </select>     </div> </div> <?php } ?> 

thanks have tried me!


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -