vikela Posted September 24, 2009 Share Posted September 24, 2009 hi suppose i have a table with a column that can have values of between 1 and 10 only and i would like to display on a user form values that are not yet in the column.i would like the values to be in a select menu.so far i have something like this.. <?php foreach ($find as $rows){ if(!in_array($rows['rank'],$arr)){ ?> <option value="<?php echo $value; } ?>" <?php if($value!=$rows['rank']) {echo "selected=\"selected\"";} ?>><?php echo $value; ?></option><?php} } ?> Quote Link to comment https://forums.phpfreaks.com/topic/175344-displaying-entries-not-in-column/ Share on other sites More sharing options...
smerny Posted September 24, 2009 Share Posted September 24, 2009 what exactly is it doing compared to what you want it to do? from a quick glance it looks like it should work... assuming you have the <select> tags around the loop Quote Link to comment https://forums.phpfreaks.com/topic/175344-displaying-entries-not-in-column/#findComment-924094 Share on other sites More sharing options...
Mark1inLA Posted September 24, 2009 Share Posted September 24, 2009 Mixing PHP and HTML makes the code very hard to read Quote Link to comment https://forums.phpfreaks.com/topic/175344-displaying-entries-not-in-column/#findComment-924474 Share on other sites More sharing options...
smerny Posted September 24, 2009 Share Posted September 24, 2009 HTML is basically the output for PHP... Quote Link to comment https://forums.phpfreaks.com/topic/175344-displaying-entries-not-in-column/#findComment-924487 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.