I've been able to retrieve multiple rows from a table and cause the selection of the first one in a list box using this code:
<select name="categories[]" size="6" multiple id="categories">
<option value="Accounting" <?php if ("Accounting" == $cat_row['category']) {echo "SELECTED";} ?>>Accounting</option>
Naturally, this is just part of the list box, but it continues in this same way. As it is right now, the first record found will get selected in the listbox, but no others. I know I have to loop through, but I'm not sure of the syntax. I've tried using
while ($cat = mysql_fetch_assoc($cat_result))
just and then putting all of the listbox code in {}, but it still doesn't work. I thought I'd be able to use this to walk through each record and make the selection in the listbox each time, but something isn't working. Does anyone know what I might be missing? Thanks.