you can store multiple categories id comma separated in the same column in database(categories_id).You can use inbuilt function of php like implode(). to do this. EX. $categories= implode(',',$_POST['categories_arr]); you can store $categories directly to the database.