Here's my set-up:
Tables:
products
- prod_id
- productname
statements
- statement_id
- author
- description
- prod_id
I have a "New Statement" form that, when someone fills it out, they can check one of the checkboxes that are listed in front of the productnames from the 'products' table.
I have it set up now where when someone checks one or more checkboxes, the values (named prod_id) go into the statements.prod_id field seperated by commas. So I might have a field with a value of 1,2,3,4 if someone checks all 4 displayed products.
My question is, I have an edit form where the author and description are all populated according to whatever statement_id is called form the statements table. How can I also check the checkboxes according to what prod_id numbers are in the statements.prod_id field?
How can I check to see if the products.prod_id that's being listed with a checkbox is in a record's statements.prod_id field? And check it for each product in the products db?
Any help is greatly appreciated.