Welcome Guest, Not a member yet? Register   Sign In
select multiple categories using join method
#1

I have this database table structure for posts, categories and post_categories

posts: 
Code:
| id | title | details
| 1  | test  | test details

categories: 
Code:
| id | name     | parent_id
|. 1 | cat one  |     0
|  2 | cat two  |     0
|  3 | cat three|     0

post_categories
Code:
|category_id|post_id
|.     1    |.   1
|.     2.   |.   1


I insert multiple categories using input checkbox for each post in post_categories table. Now in update page i need to show categories list and checked input checkbox. how do can i generate this output using join method?!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB