I have a multiselect list element that draws its content from a mysql database. When somebody chooses the items they want from the list, thier selections are given a number and saved to a different table in the same database.
I am trying to set it up so that the list is formed from table one, but the items that where saved to table two get "selected" added to the input code.
Code: Select all
<select name="selectfiles[]" size="5" multiple="multiple" class="textlist" id="selectfiles">
<?php do { ?>
<option value="<?php echo $row_filelist['ID']; ?>"<?php if ( $row_selectedfiles['ID'] == $row_selectedfiles['file'] ) { echo " selected"; }?>><?php echo $row_filelist['filename']; ?></option>
<?php } while ($row_filelist = mysql_fetch_assoc($filelist)) || $row_selectedfiles = mysql_fetch_assoc($file)); ?>
</select>filelist is the full list of items in the first database table.
selectedfiles is the limited list of items from the second database table.
Any ideas, any questions if you dont understand what I'm doing?
THANKS!!!