Select Multi Select

I’m sure I’m missing something simple but I’m stumped.

I have a multi-select field which gets a list of categories from the tbl_categories table. I then have a table tbl_stocks which has a list of stocks and a table tbl_stock_categories which stores the category id’s associated with each stock id.

First of all what I need is to be able to have the multi-select field select the already selected values from the tbl_stock_categories table. Then when I save the form I need those values to update if they’ve been changed.

I suppose I could just put a category_ids field in the tbl_stocks table but if there was a straightforward way to do it with my current database structure I would prefer that.

Thanks.

Community Page
Last updated: