jarv Posted June 27, 2008 Share Posted June 27, 2008 At the moment my code outputs many select boxes with all dates, I want one select box with all the dates, how can i do this? $result3 = mysql_query("SELECT HeaderDate FROM Headertbl"); while($row2 = mysql_fetch_array($result3)) { $HeaderDate = $row2['HeaderDate']; echo '<h2><select name="$HeaderDate"><option value="'.$HeaderDate.'">'.$HeaderDate.'</option></select></h2>'; } Quote Link to comment Share on other sites More sharing options...
xyn Posted June 27, 2008 Share Posted June 27, 2008 I think you mean this: $result3 = mysql_query("SELECT HeaderDate FROM Headertbl"); print '<h2><select name="$HeaderDate">'; while($row2 = mysql_fetch_array($result3)) { echo "<ption value=\"{$row2['HeaderDate']}\">{$row2['HeaderDate']}</option>'; } print '</select>'; Quote Link to comment Share on other sites More sharing options...
jarv Posted June 27, 2008 Author Share Posted June 27, 2008 thanks you very much Quote Link to comment 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.