s4salman Posted March 19, 2016 Share Posted March 19, 2016 I want to repeat this form 40 times. Can any body help me with php code. Below, is the one row printing 06 drop down list. I want to repeat this thing 40 times. What is mean is that repeate this 06 drop down field 40 times. <tr> <td width="100%" ALIGN="CENTER"> description<input type="text" name="description"> </td> </tr> </table> <table border="0" cellpadding="2" cellspacing="8"> <tr> <td width="10%" ALIGN="CENTER"> <label for="element_1"> </label> <div> <?php $sql="SELECT * FROM tutorial order by field1"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field1]>$row[field1]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </div> </td> <td width="20%" ALIGN="CENTER"> <label for="element_1"> </label> <div> <?php $sql="SELECT * FROM tutorial order by field2"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field2]>$row[field2]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </div> </td> <td width="10%" ALIGN="CENTER"> <label for="element_1"> </label> <div> <?php $sql="SELECT * FROM tutorial"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field3]>$row[field3]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </div> </td> <td width="10%" ALIGN="CENTER"> <label for="element_1"> </label> <div> <?php $sql="SELECT * FROM tutorial order by field1"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field1]>$row[field1]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </div> </td> <td width="20%" ALIGN="CENTER"> <label for="element_1"> </label> <div> <?php $sql="SELECT * FROM tutorial order by field2"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field2]>$row[field2]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </div> </td> <td width="10%" ALIGN="CENTER"> <label for="element_1"> </label> <div> <?php $sql="SELECT * FROM tutorial"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field3]>$row[field3]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </div> </td> </tr> Quote Link to comment https://forums.phpfreaks.com/topic/301045-repeatition-for-drop-down-list/ Share on other sites More sharing options...
mac_gyver Posted March 19, 2016 Share Posted March 19, 2016 I want to repeat this form 40 times. probably not. there's two problems with this. 1) no one is likely to want to go through 40 or 6 * 40, depending on what your statement about what you are doing means, different select/option menus (there's probably a better interface to do this), and 2) this shows that your database table has designed badly. so, what does this data actually represent and how many select/option menus are there in each form and how many forms are there? Quote Link to comment https://forums.phpfreaks.com/topic/301045-repeatition-for-drop-down-list/#findComment-1532215 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.