Multiple categories selection system for Article
Earlier M using two tables articles & categories and save category ID in articles table But in this system I can save only one category ID per article I want to save Article in Multiple categories
While searching I found same question on StackOverflow
I understand the whole concept of adding one more table of relationship & saving Article ID & Category ID in this table. But not aware how to implement multiple selection system using arrays in New Article Form & Edit Article Form.
earlier I am showing Select in my form to display categories list in Add Article & Edit Article Page.
pls someone explain me How to show categories list in multiple checkbox style in my form so user can select multiple categories and then after POST how to get checkbox data and run query to insert data in both Article Table & New Relationship table with selected categories ID
want to display category List like this screenshot
Many Many Thanks...
EDIT:
I use echo '<input type="checkbox" name="selcats[]" value="$catid"> ' .$catname;
to display Categories check box
Its showing in a row side by side.
how to change display like screenshot i.e. list with scrollbar
& need to process this array and insert in new table while inserting article in databse.
EDIT 2
got the checkbox display correct in a scroll list by using a div :D
<div style="height: 150px; width: 200px; overflow: auto;">