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} } ?> 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 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 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... 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
Archived
This topic is now archived and is closed to further replies.