redarrow Posted February 23, 2009 Share Posted February 23, 2009 advance thank you. how can i show, that number 0 is the word "select". keep getting a infinity loop,please show me a example cheers. <select name="podcast_programming_years"> <?php for($py=0; $py<50; $py++){ echo"<option value='$py'>$py</option>"; } ?> </select> Link to comment https://forums.phpfreaks.com/topic/146508-solved-loop-help-please/ Share on other sites More sharing options...
wrathican Posted February 23, 2009 Share Posted February 23, 2009 <select name="podcast_programming_years"> <option value=''>Select:</option> <?php for($py=1; $py<50; $py++){ echo"<option value='$py'>$py</option>"; } ?> </select> Link to comment https://forums.phpfreaks.com/topic/146508-solved-loop-help-please/#findComment-769145 Share on other sites More sharing options...
phpdragon Posted February 23, 2009 Share Posted February 23, 2009 something like this echo "<option value='$py"; if ($py=='0') { echo " selected='selected'"; } echo ">$py</option>\n"; } Link to comment https://forums.phpfreaks.com/topic/146508-solved-loop-help-please/#findComment-769149 Share on other sites More sharing options...
redarrow Posted February 23, 2009 Author Share Posted February 23, 2009 There my doing it the hard way, thank you so much. SOLVED Link to comment https://forums.phpfreaks.com/topic/146508-solved-loop-help-please/#findComment-769152 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.