I am trying to pull all categories for a blog post when the blog is loaded. I have 2 tables for categories, one for the categories themselves and another that lists which categories are assigned to which blog post.
the MySQL command I have is
SELECT `category_name`, `category_slug` FROM `blog_categories`, `blog_post_categories` WHERE `blog_categories.category_id` = `blog_post_categories.category_id` AND `blog_post_categories.post_id` = 1
But I keep getting the following error
Unknown column 'blog_categories.category_id' in 'where clause'
The two tables are as such:
blog_categories has columns category_id, category_name and category_slug blog_post_categories has columns id, post_id and category_id