There are 2 MySQL tables: 'posts' and 'category'. Unfortunately there is no taxonomy table.
Categories:
id: integer
name: string
Posts:
id: integer
name: string
body: text
tag: string
category: string
So, in category there is:
id name
1 Books
2 Animals
And Post:
id name body tag category
1 My Post Hi post my-post 1
2 Post 2 2nd Post post-2 1;2
This is te SQL query:
SELECT * FROM posts WHERE category = '1'
Only returns post id 1
SELECT * FROM posts WHERE category = '2'
Returns nothing
How can I get both posts with just one SQL query?