pagegen Posted September 15, 2009 Share Posted September 15, 2009 Am trying to write a nested while loop which will create 5 drop down lists all with the same options but the code below is only creating 1 drop down list with the options and the rest are all empty lists.. any suggestions <?php $numberOfRows = 1; $row = 1; $t=1; do { $handle = fopen("vicidial_temp_file.csv", "r"); echo "<select name='$numberOfRows'>"; while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { if ($row <2) { $num = count($data); $row++; for ($c=0; $c < $num; $c++) { echo "<option value='$data[$c]'>$data[$c]</option>"; } } } fclose($handle); echo '</select>'; echo $t; $numberOfRows ++; $t = $t + 1; } while($t <= 5); fclose($handle); ?> Link to comment https://forums.phpfreaks.com/topic/174320-creating-a-nested-while-loop-to-return-multiple-dropdowns/ Share on other sites More sharing options...
pagegen Posted September 15, 2009 Author Share Posted September 15, 2009 I fixed it Link to comment https://forums.phpfreaks.com/topic/174320-creating-a-nested-while-loop-to-return-multiple-dropdowns/#findComment-918953 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.